[vtkusers] python - thanks

rod holland rhh at StructureLABS.com
Mon Mar 4 00:52:11 EST 2002


Prabhu;

Thanks - I had looked at the TCL examples but not being familiar with the
language I made an error - I was coding

m.SetInput(t)  rather than   m.SetInput(t.GetOutput())

Intuitively I thought that by doing t.SetInput the TriangleFilter object
was ready to process.  Thanks for the help and thanks for writing Mayavi
and the ivtk classes.

Rod




At 08:34 AM 3/4/02 +0530, you wrote:
>>>>>> "RH" == rod holland <rhh at StructureLABS.com> writes:
>
>    RH> Can someone give me a tip on how to take a polygon data set -
>    RH> say like spleen.color.vtk and do surface area and volume
>    RH> calculations on the data set.  I am working in python (idle /
>    RH> mayavi) and have tried various approaches using
>    RH> vtkTriangleFilter and vtkMassProperties but I have not been
>    RH> succesful.  Is there a code fragment somewhere that can point
>    RH> the way?
>
>VTK 3.2 has a few examples in contrib/examplesTcl/ 
>Here is a quick and dirty example in Python.
>
>r = vtkPolyDataReader()
>r.SetFileName('spleen.color.vtk')
>r.Update()
>t = vtkTriangleFilter()
>t.SetInput(r.GetOutput())
>m = vtkMassProperties()
>m.SetInput(t.GetOutput())
>print m.GetVolume()
>print m.GetSurfaceArea()
>
>prabhu
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list