I need to iterate over the vertices of a TopoDS_Face in clockwise order and I am using the following code to do that.
TopoDS_Face face = ...;
for(TopExp_Explorer expVert(*face, TopAbs_VERTEX); expVert.More(); expVert.Next())
TopoDS_Vertex vert = TopoDS::Vertex(expVert.Current());
// process the vertex
I am finding that the vertices do not appear in the order of the edges. Also, each vertex appears twice. For example,
if I have a square with the following vertices:
v1 = (0, 0, 0)
v2 = (1, 0, 0)
v3 = (1, 1, 0)
v4 = (0, 1, 0)
The vertices do not appear in the order (v1, v2, v3, v4) as I would expect. Does anyone know the correct way of iterating over the vertices of a TopoDS_Face?