[vtkusers] How to correct winding order of a triangular mesh using VTK?

lucky f_u_7 at yahoo.com
Sun Jun 30 11:09:07 EDT 2013


I am wondering that, is there any function in VTK that corrects the winding
of a triangular mesh?
I am not talking about to correct the normal orientation, here I want to
correct the winding order of 3D mesh not just 2D.

VTK provides us three classes vtkTreeBFSIterator, vtkTreeDFSIterator,
vtkEdgeListIterator which can iterate over all the edges. The algorithm to
correct the winding order of triangles is simple theoretically, but its is
so much complicated in implementation. I have been working on it since
several months but I couldn't get the success. The algorithm is, we need to
check every egde with its neighbor triangle's edge, if the winding order is
same of both edges, then swap the edges. 

Is there any fucntion in VTK that returns the vtkPolyData in a correct
winding order? 
Something like that..For example:

vtkSmartPointer<vtkCorrectTrianglesWinding> cw =
vtkSmartPointer<vtkCorrectTrianglesWinding>::New();
vtkCorrectTrianglesWinding->input(polydata);
vtkCorrectTrianglesWinding->update();

vtkPolyData *tri = vtkCorrectTrianglesWinding->Getoutput();


I want something like that. Please guide me if there is a way to do that in
VTK? or tell me how can I do this to correct the winding order of a
triangular mesh?

<http://vtk.1045678.n5.nabble.com/file/n5721687/CIomS.jpg> 
<http://vtk.1045678.n5.nabble.com/file/n5721687/NDcUc.jpg> 



--
View this message in context: http://vtk.1045678.n5.nabble.com/How-to-correct-winding-order-of-a-triangular-mesh-using-VTK-tp5721687.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list