Sort curves by vertices

I have 3d geometry with flat sections (red) which vertices are connected by lines (green). I want to label each vertex and show them on planar flat view with curves like on picutres. I have tried by unrolling surfaces but it doesnt seems to work.
I want to turn this:

into this (with all vertices labelled):
sorting_vertices.3dm (191.1 KB) (240.0 KB)

Hello sailor!
Something like this perhaps?

Best regards,
Sir Ernest Shackleton (24.7 KB)

Thanks for answer but no. Red sections and green connector lines must be separately like on picture I’ve uploaded before.

I’ve handled sorting points and labeling but have no idea how to make them flat with labels.

I’ve made it for red curves. I guess it is not most handy solution. Any ideas how to make it for green ones?

sorting_vertices.3dm (181.3 KB) (843.5 KB)

This is a classic Graph (or Mesh) connectivity puzzle … meaning that you’ll need VV and EV conn trees plus some basic bool ops with indices Lists (in order to locate the vertices loop(s) [conditional closed cirquits as we call them in graphs] that you want [and anything else] etc etc). If you are 100% familiar with these AND with coding matters notify for a C# solution. That said (case Mesh) MeshTopologyVertexList Class has a handy Method that sorts the neighbor vertices/edges (by the topo vertex index). Keep in mind that Vertices and Topology Vertices are NOT the same thing and have NOT the same indexing in a mesh.

1 Like

Thanks for answer. Well I’m not that advanced in gh and C# yet :neutral_face: I wonder if there is a simpler way like measuring distance between vertices and simply draw them flat with corresponding dots… …or unroll surfaces with green lines and remove these which duplicate red ones…but how? :thinking:

Well … I have always the general case in mind when dealing with stuff like this: meaning a big and complex [say 1++ K nodes etc etc] Graph/Mesh with islands. So first comes island detection (via the VV conn Tree) and then the rest.

If you have other “challenging” cases in mind as well … don’t even think to deal with them without connectivity (and code).

Detecting sections and connectors isn’t big issue. They are on separated layers.
Below is best solution so far but there is one more issue remained.
So I’ve got two lists. One with red lines and second with green ones. How to remove line on one list if it occurs on second list? How to remove same lenght line or same dots line? For eg this line.

sorting_vertices.3dm (187.9 KB) (1.6 MB)
Is there a lists master on forum?

Well … let’s assume that reds and greens lay in different planes (i.e. are not coinsident) : the general case is to sample, say, directions (i.e. Vectors) related with the red lines and then test them against the directions related with the green ones.

Tip: Since you said that you are in the code learning path … this is a good entry level C# task for you: use the vect1.IsParallelTo(vect2, atol) Method (that yields 1 or -1 [case parallel/antiparallel]) and skip each green that yields a value 1/-1.

For that you’ll need obviously a double loop (foreach green … foreach red).