[vtkusers] calculating volume of unstructured grid

Murat Aydın murat.aydin at netcad.com.tr
Thu May 14 07:26:03 EDT 2009


Hi,

How could volume of a solid that is constructed from unstructured grid be calculated?

Answer:
We can use vtkMassProperties and ss you know vtkMassProperties gets poly data as input. So before using it we have to
do some conversions.
I use unstructured grids to form a volume with Delaunay3D algorithm. After that i set the output of Delaunay 3D to input
of vtkGeometryFilter. vtkGeometryFilter converts data to poly data. Then i set output of vtkGeometryFilter to input of
vtkTriangleFilter. Because poly data should be triangulated before vtkMassProperties. Then i set output of vtkTriangleFilter
to input of vtkMassProperties. And GetVolume() method of vtkMassProperties gives the calculated volume.

In a nutshell, 
unstructured grid -> vtkDelaunay3D -> vtkGeometryFilter -> vtkTriangleFilter -> vtkMassProperties -> volume.

Hope this helps.

murat aydin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090514/3a1f1e44/attachment.htm>


More information about the vtkusers mailing list