[vtkusers] How to find the volume enclosed between two open surfaces ???? Please Help !!!!!!!!

Amy Squillacote amy.squillacote at kitware.com
Thu Nov 17 08:35:20 EST 2005


Hi Deepak,

You could try appending your two vtkPolyDatas together using the 
vtkAppendPolyData filter, and then run the vtkMassProperties on the 
output of the vtkAppendPolyData filter. There is a method in 
vtkMassProperties called GetVolume that appears to do what you want.

You do need to make sure that your data sets are composed only of 
triangles before running vtkMassProperties. From vtkMassProperties.h:

// Currently only triangles are processed. Use vtkTriangleFilter to
// convert any strips or polygons to triangles.

So, actually you need a vtkTriangleFilter before vtkMassProperties 
and after vtkAppendPolyData.

- Amy

At 06:45 PM 11/16/2005, Deepak Roy wrote:
>I have two open surfaces in the form of vtkPolyData. I want to find 
>the volume enclosed between them. Does anyone know how to do this ?
>
>For example, consider two open surfaces
>
>1. a hemisphere
>
>2. a square shaped plane sheet.
>
>
>Now if i place the hemispherical surface on the plane sheet with the 
>plane sheet acting as a base for the hemispherical surface.
>
>Now we have a hemispherical volume enclosed between the two surfaces.
>
>The question is how can i find this volume in VTK ?
>
>I have an idea to do this in opengl:
>
>    * I will first render the plane sheet to an offscreen buffer. 
> Then i will read the z-values  or the in other words the depth 
> values from the z-buffer.
>    * I will then render t! he hemipsherical surface to the 
> offscreen buffer and read the depth values again.
>    * Then the difference between these two depth maps gives the 
> volume enclosed between the two surfaces.
>I did not find features in VTK to do this.....
>
>Does anyone know a better way to calculate the volume than this ?
>
>Please help !!!!!!
>
>Thanks in advance !!!!
>
>Regards,
>
>Deepak Roy
>
>
>
>
>
>
>
>
>
>
>
><http://us.lrd.yahoo.com/_ylc=X3oDMTFqODRtdXQ4BF9TAzMyOTc1MDIEX3MDOTY2ODgxNjkEcG9zAzEEc2VjA21haWwtZm9vdGVyBHNsawNmYw--/SIG=110oav78o/**http%3a//farechase.yahoo.com/>Yahoo! 
>FareChase - Search multiple travel sites in one click.
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051117/fb64a57d/attachment.htm>


More information about the vtkusers mailing list