Reorder planes of a irregular mesh

Hello lords of GH
I have a problem with this project and I would like to ask to your knowledge some suggestions.

  1. I have this irregular mesh.

  2. I am taking all the faces that collide with each vertex. Depending on the case, it could be from 1 to 5 faces. it is a quad-based mesh, so the most common case is 4 faces related to each vertex.

  3. The operation that i am doing with each vertex-faces demands to have the same order of the faces around their vertex. This is easy with a UV organised mesh, but this is an irregular mesh. What i am trying to do is to sort the faces around each point to get the same order in all the cases.

  4. TO ACHIEVE THIS, I tried to place a plane in each vertex in the correct direction to later sort the faces in the same order.

  5. I haven’t succeeded. The planes change of directions when it reaches the limits and the curves.

Could you help me with some ideas to place the planes in each vertex in a organised way

IRREGULAR MESH

EACH VERTEX IS TAKING THE COLLIDING FACES // THE ORDER OF THE FACE #0 IS DIFFERENT PER VERTEX

THERE ARE PARTS WHERE THE PLANES THAT I PLACE IN EACH VERTEX FOLLOWS THE SAME DIRECTION

THERE ARE SOME PARTS WHERE THE PLANES CHANGE OF ORIENTATION

Here I am leaving the file. The collision part is turned off because is really heavy. If you think there is other way to sort the faces around each point you can turn it on but it will take 5 min or so to run the collision.
If there is any other idea to reach the main goal ( the faces around the vertex are taken in the same order for each vertex) please leave it to me. I would appreciate any help.

Euston Station Section.3dm (426.6 KB) section-mesh reorder.gh (17.6 KB)

THANKS TO YOU ALL

This is interesting, so I gave it a go :slight_smile:

The sorting is possible but there are some places where the best orientation is not 100 % clear. Instead of collision, I used Sandbox: https://www.food4rhino.com/app/sandbox-topology

It could also be done with code but I can’t do much more than copy paste so you’d need help from someone else.

For each point, I extracted the adjacent vertices. The faces are sorted counter-clockwise on a plane with its X-axis on the mesh edge closest to a vector perpendicular to Z and vertex normal.

20_05_10_mesh_sorted_adjacent_faces.gh (308.8 KB)

To get the faces connected to a vertex, you can use this function
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Collections_MeshVertexList_GetVertexFaces.htm

like this:

vertexfaces.gh (5.3 KB)

2 Likes

Updated the file with Daniels c# code

20_05_10_mesh_sorted_adjacent_faces.gh (308.6 KB)