[vtkusers] compute polygon centroids and normals

Matt and Elizabeth Kay mandekay at yahoo.com
Thu Jul 18 17:06:45 EDT 2002


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



More information about the vtkusers mailing list