0

I'm trying to calculate the volume of an unstructured grid using mayavi and tvtk. My idea was to tetrahedronalize the Point cloud by means of the Delaunay3d-Filter. Then I Need to somehow extract the tetrahedra from this dataset while ignoring other cell-types such as lines and triangles. But how can i accomplish this? My Python code so far Looks as follows:

import numpy as np
from mayavi import mlab

x, y, z = np.random.random((3, 100))
data = x**2 + y**2 + z**2

src = mlab.pipeline.scalar_scatter(x, y, z, data)
field = mlab.pipeline.delaunay3d(src)

Can i use the field-object to retrieve the polyhedras Vertices?

Thanks in advance. frank.

Andrea
  • 6,032
  • 2
  • 28
  • 55
OD IUM
  • 1,555
  • 2
  • 16
  • 26

1 Answers1

0

Is this the best way to go about it? scipy.spatial has delaunay functionality as well. Having recently worked with both myself, I would note that scipy is a much lighter dependency, easier to use, and better documented. Note that either method will work on the convex hull of the pointcloud, which may not be what you want. the scipy version also easily allows you to compute the boundary primitives as well, amongst other things, which may be useful for further processing.

Eelco Hoogendoorn
  • 10,459
  • 1
  • 44
  • 42
  • Thanks for your advice, I'll have a look on it. However, I still want to know how to get the Output-data of any Filter/Module I have applied to my original data. Any ideas? – OD IUM Jan 13 '14 at 13:50
  • not really, no; im always struggeling with the limited documentation of mayavi myself. what I usually do is go to the VTK C++ documentation, and try to find the analogues in mayavi. – Eelco Hoogendoorn Jan 13 '14 at 14:18