Closed petrasvestartas closed 7 years ago
Hey Petras, I'm not really sure what you're trying to achieve. To answer simply, no, the PlanktonMesh
doesn't know anything about the Rhino.Geometry.Mesh
that it may have been created from.
However, if you study the ToPlanktonMesh()
code then you'll see that each Rhino Topological Vertex becomes a PlanktonVertex
, so if you're careful about not modifying the topology after constructing the PlanktonMesh
, then you could use this relationship.
int v1 = planktonMesh.Halfedges[i].StartVertex;
int v2 = planktonMesh.Halfedges.EndVertex(i); // shortcut to get the start vertex of the previous halfedge
This isn't foolproof though. This method attempts to tidy up the Rhino.Geometry.Mesh
before constructing the PlanktonMesh
(welding, unifying normals, etc.).
Hi,
Thanks, this is only for kangaroo hinge goal, where I take original mesh and decompose to 4 points.
I have example with rhinocommon which is ... long one.
And plankton example with 4 lines.
Does the index of plankton mesh corresponds to mesh.vertex or mesh.topologyvertex index?
If you use ToPlanktonMesh()
then the initial indices of vertices in the PlanktonMesh
correspond to the topology vertices, not the actual vertices.
Works like a charm thanks:)
Hi,
Is it possible to take plankton mesh vertex index:
int index = planktonMesh.Halfedges[i].StartVertex;
and get the index of rhino mesh vertex?
var someVertex = rhinoMesh.Vertex[ indexFromPlankton ]
Kind Regards, Petras