Closed mmedinav18 closed 4 years ago
Also, I noticed that the face index =-1. I've attached an image of the code I am working with for better understanding.
-1 for PlanktonHalfedge.StartVertex
sounds like a bug. Plankton should maintain the StartVertex
property for you, unless you directly create/modify the halfedges yourself. How are you constructing the PlanktonMesh
? Are you using PlanktonFaceList.AddFace()
? AFaceIndex
of -1 is normal and just means that the half edge has no adjacent face, i.e. it's on a boundary.
So what I am doing to create the Plankton mesh is basically get the vertices from a remeshed geometry. I am using geometry3dSharp library to remesh this geometry, then use the vertices to create the Plankton mesh vertices and I use planktonMesh.Faces.AddFace(a,b,c,d). The indices for the faces I've gottent them from a function from the other library. For clarification I've included what I am doing in the image below. For the faceindex of -1, I am not quite sure if that's correct since at the moment I am using a sphere, so no boundary.
Hope it makes sense.
Sorry for the late reply. It looks like you're trying to quadrangulate a triangular mesh. I would try building the plankton mesh directly from the triangular faces and check that it comes through correctly.
Hi,
I am following one of your advices from a prevoius thread (https://github.com/meshmash/Plankton/issues/41) to get adjacent faces of a halfedge. The issue I am having is that while it works at times, there are times that an error comes out with the index being out of range. I dug a bit deeper and I noticed that the index value for the startVertex = -1, which is what is causing the error. I've been reading the source code to try to identify how to work around the issue, but truly don't know how to fix it. Could you please explain why the start vertex index comes out as -1?