Ordering mesh naked Edges

Hi,

When I extract mesh naked edges using:
if(brepMesh[i].TopologyEdges.GetConnectedFaces(j).Length == 1)
Edges Are not ordered:

1

What would be the method to order edges?
Do I need to use DepthFirstSearch? Or there is a simpler method?

how about brepMesh[i].GetNakedEdges()? it returns polyline(s) which are ordered by definition.

But I need indices in continuos order, not geometry.

Ah, ok. I have no idea sorry…

I guess what you could do is Mesh.GetNakedEdgePointStatus() to get all the vertices’ (not topology vertices!) naked edge statuses. Then start at one vertex and enumerate all edges that radiate from that vertex. Take the edge that has a naked opposite vertex and keep going from that vertex until you reach the beginning.

1 Like

Thanks this seems to be a good approach working with adjacency.

Hi Menno, Any idea how you would go about doing this but with topology vertices?

In the end I did this with topology vertices, by checking both naked point status and which edge is the next and not previous. This also works with meshes that have holes

Thanks Petras for the prompt reply. I will give it a go with your approach to see if I obtained the results I am looking for.