[vtkusers] compute polygon centroids and normals

Mathieu Malaterre mmalat at imaging.robarts.ca
Thu Jul 18 17:29:03 EDT 2002


Hi Matt and Elizabeth ,

You can have a look to this class that compute the normals:
http://public.kitware.com/VTK/doc/nightly/html/classvtkPolyDataNormals.html

But for the centroids I don't know...you may adapted this class ?

HTH
mathieu


Matt and Elizabeth Kay wrote:

> Hi all-
>
> I am computing the centroid of each polygon in a
> vtkpolydata (which are triangles) as well as the
> normal of each triangle. I have done this by
> extracting the verticies of each triangle and
> computing the centroid by taking the average of the 3
> verticies. I am fitting a plane to the verticies to
> get the normal of each triangle. I feel like I am
> reinventing the wheel - I have looked but I haven't
> found a vtk function that does this. Any suggestions?
>
> Also- how can I order verticies in my polydata such
> that they are always referenced clockwise or
> counterclockwise for each triangle? I am thinking this
> may help with providing consistently oriented normals
> (ie: outward or inward). Any suggestions would be
> greatly appreciated!
>
> Thanks in advance,
> Matt
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Autos - Get free new car price quotes
> http://autos.yahoo.com
> _______________________________________________
> 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

--
If all else fail read the instructions
Malaterre, Mathieu
The John P. Robarts Research Institute
Imaging Research Laboratories
http://www.imaging.robarts.ca/~mmalat






More information about the vtkusers mailing list