# How Mesh Vertices Topology is built?

Hi,
Does someone could explain how the vertices topology is defined?
I have two similars meshes, built from scratch with Point3d and Face index. Face index are ordered the same. Point location is almost similar. Basicaly the meshes are built exactly the same way. However the vertices typology changes. May be buggy?
thx
Attached rhino file and Grasshopper file that helps to display vertices topology.

Mesh Vertices Topology.3dm (27.9 KB)
TopologyIssue02.gh (10.6 KB)

The topology is correct, but it has different indices. I don’t think you can expect the topologies to be the same in their index numbering, only that they describe the topology of the meshes correctly. This is especially important if each face has its own vertices and consequently vertices are duplicated in the vertex list. That makes it impossible to do face-neighbor analysis without a description of the topology.

What do you want to use the topology for that this is a problem for you?

Hi Raf

that is probably a correct topology. TopologyVertices are not ordered in a necessary way. They allow you to navigate the mesh by knowing which mesh Vertices are coincident, which edges they share, in which face they are present, etc.

As an example, you can use

``````vi_of_first_top_vertex = x.TopologyVertices.MeshVertexIndices(0)
print(vi_of_first_top_vertex[0])
``````

…to print the first mesh vertex index of the first topology vertex.

Thank you for your help. The topology is correct, but as the meshes are built excatly the same, with a slightly different point coordinates, I see no reason the indices are differents. Obviously there is one, and I would like to understand it. With an unweld mesh case, if the meshes are built the same way - by same way I mean same face indice order - the topology indices should also be the same. no?

Hi Piac,
thank you for your help. Understood about TopologyVertices purpose and how to access to indices, etc… but I still don’t understand why indices change on similar built meshes. Did you have a look at the gh file? maybe it helps to understand my case…

Why not create an own order system? Filter them on X, Y or Z axis?

What do you want to use the topology for that this is a problem for you?

I have a mesh which is iteratly deformed and I need to preserve the mesh topology for each iteration.

Why not create the mesh once, compute the topology once, then only deform the vertices of the existing mesh. Then the topology is preserved.

This is a known limitation of Rhino 5. It has already been addressed in Rhino WIP. Simply rotating the geometry or scaling it will no longer change the order of TopologyVertices. For now, you could keep track of which MeshVertices those TopologyVertices correspond to. Would that be enough?

Is rhino WIP already accessible? I will be very interested to test it. In the mean time I will find a trick. But it’s good to know that it will be adjusted in the next release. Thx

This doesn’t work. If you deform the vertices, the topology is not preserved…