Hi
There seems to be some issues with the Brep edge enumerator. Firstly, after 4 edges it is not returning Current to null.
But more importantly, the last edge of the loop appears to have vertex1 and vertex2 flipped - so the last edge is pointing in the opposite direction. Is this a know issue? Does it happen with every edge?
Thanks
Hi,
After the edge enumerator is obtained, the "MoveNext" method is to be used. The return value of this method will position the enumerator at the begin and indicate if it is safe to continue iterating further. The other way is to use the "foreach" to iterate.
Here is a sample code :
using (BrepEdgeEnumerator brepEdgeEnum = brep.Edges.GetEnumerator()) { bool canContinue = brepEdgeEnum.MoveNext(); while (canContinue) { Edge edge = brepEdgeEnum.Current; Autodesk.AutoCAD.BoundaryRepresentation.Vertex v1 = edge.Vertex1; Point3d pt1 = v1.Point; ed.WriteMessage("\n --> Vertex 1 : {0}", pt1); Autodesk.AutoCAD.BoundaryRepresentation.Vertex v2 = edge.Vertex2; Point3d pt2 = v2.Point; ed.WriteMessage("\n --> Vertex 2 : {0}", pt2); canContinue = brepEdgeEnum.MoveNext(); } }
About the last edge flipping its vertices - No, this is not a known behavior. It might be specific to the entity on which you are using BRep. Can you please try on a simple planar surface created in AutoCAD and is the same behavior reproducible ?
Regards,