I seem to not be getting the right connected vertices ids from the GetConnectedVertices call via C#/Rhinocommon. It seems to work fine with a quad mesh I have, but not the triangular one. Some vertices are returning ids of themselves. Please find attached the GH file with mehses internalized.
Hi Laurent, thanks for the response!
I filtered the result by simply saying something like <if(id != i)> for now,
but am wondering if there are other ways around this since it might be troublesome later on because I will actually be operating with the connected vertices.
As there is no fix now you have to take it into account. @piac is there a fix planed for this bug ?
Here an example with TopologyVertices with no errors at first sight
List valence = new List();
DataTree v_vid = new DataTree();
for(int i = 0; i < m.TopologyVertices.Count; ++i){
int[] vid_temp = m.TopologyVertices.ConnectedTopologyVertices(i);
int [] vid_mes = new int[vid_temp.Length];
for (int j = 0; j < vid_temp.Length; j++)
{
vid_mes[j] = m.TopologyVertices.MeshVertexIndices(vid_temp[j])[0];
}
foreach(int id in vid_mes){
v_vid.Add(id, new GH_Path(m.TopologyVertices.MeshVertexIndices(i)));
}
}
for(int i = 0; i < m.Vertices.Count; ++i){
valence.Add(m.TopologyVertices.ConnectedTopologyVertices(i).Length);
}
A = v_vid;
B = valence;
Hi Laurent, thanks so much!
The problem of using TopologyVertices is that the index might not be consistent throughout right?
For example, if I were to iteratively move vertices around, they might be re-sorted?
It seems like you are avoiding that problem by matching the indices back to the original mesh indices?