
Hi, the problem is that you are adding the same vertex (vhandle[4]) into the two triangles. This will create a non-manifold configuration. Either you create another vertex and add that to the second triangle split, or you remove the second parameter from the split calls and OpenMesh will do a one to four split. Best, Jan Möbius
Hello,
I am just getting started with OpenMesh and learning the halfedge structure. I am trying to split a face and then split it again to ultimately create areas of different densities that looks something similar to the picture below.
I have tried to use the following code: int main() { MyMesh mesh; // generate vertices MyMesh::VertexHandle vhandle[5]; vhandle[0] = mesh.add_vertex(MyMesh::Point(0, 0, 0)); vhandle[1] = mesh.add_vertex(MyMesh::Point( 0, 10, 0)); vhandle[2] = mesh.add_vertex(MyMesh::Point( 10, 10, 0)); vhandle[3] = mesh.add_vertex(MyMesh::Point(10, 0, 0)); vhandle[4] = mesh.add_vertex(MyMesh::Point(5,5,0));
mesh.add_face(vhandle[2], vhandle[1], vhandle [0]); mesh.add_face(vhandle[2], vhandle[0], vhandle [3]);
mesh.split(mesh.face_handle(0), vhandle[4]); mesh.split(mesh.face_handle(1), vhandle[4]);
// This face_handle is generated from the previous split // and is the one causing errors mesh.split(mesh.face_handle(2), vhandle[1]);
However when I try to load the output.off file into a mesh viewer I get the error, "warning mesh contains 0 vertices with NAN coordinates and two degenerated faces". Do you have any recommendations on how to create a mesh with a large amount of faces? I am relatively new to c++ as well as mesh generating so I feel like I'm taking the most difficult approach to this.
Thank you in advance for your help and I apologize if something like this has been answered in the documentation but I could not find it.
- William
-- Jan Möbius Department of Computer Science 8 Aachen University of Technology (RWTH) Ahornstrasse 55, 52074 Aachen, Germany Phone ++49 (0)241 80-21802 Fax ++49 (0)241 80-22899 mailto:moebius@cs.rwth-aachen.de http://www.rwth-graphics.de