Subject: CGAL users discussion list
List archive
- From: Rash <>
- To:
- Subject: [cgal-discuss] Surface Mesh indices are invalid during manual export
- Date: Thu, 6 Jun 2019 22:47:08 +0200
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
- Ironport-phdr: 9a23:7VxdNR38/10V6KlysmDT+DRfVm0co7zxezQtwd8Zse0WL/ad9pjvdHbS+e9qxAeQG9mCsrQd17ad6vyxEUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCegbb9oMRm7ogrcusYLjYZtLqs61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoBOjUk8m/Yl9ZwgbpFrhyhuhJxwIDab4+aO/Vica3QZs8aSGhbU8pNSyBMDIGxYo0SBOQBJ+ZYqIz9qkMSoxSkHgmsBP7kxzhShnDsxq060+UhHhzd0QwlHtIOtG7bo8nyNKcXS+y60bfHwCzFYvhL2jn98JDFfxMhrP2WQL59f9DdxVQhGg7BlFmctI/oMjCN2ukOsGWX9ehtWf61h2I5tQ19vyKjytkwhoTGgI8e10rK+j9jwIkvIN21UE57bsCgEJtXryyVKpZ5Tt4mTmxnpio3xacKuZ2hcygR05Qo2QTfa+KZfIiS+B7sSOGRITJgiHJkfrKwmQqy/FCjx+D8TMW4zVhHojBYntTCsn0BzQHf58uER/dl+0euwzeP1wTd6uFeJkA0kLLWK4Q7zb4rlpoTsFnMEzTzmEX3iK+ZbFkr+u+t6+j9f7rpuIeQN5VohQHmLqQuhsu/DPwkPQgBRWeb/f2w26Di/U3iXLpKk+Y2krLCvZDBJcUbo7a5DBVP3oYi7Ra/FTam384CkXkJNlIWMC6A2oPmMlWLLPHjBuqkmHytli1qzrbIJO7PGJLIe0LKi7epKax08E5dxCI2zNRW7JVRTL0MdqGgEnTtvcDVW0dqeze/xPzqXY0kh9EuHFmXC6rcC5v89FqB5+YhOe6JPdVHvTf5IvMi4rjigC1hwANPTeySxZISLUuAMLF+OUzAOyjpg9MIGmAP+AYzHrSz1Q+yFAVLbnP3ZJoSozE2DIX8VtXPStn83ObdmiSyBYZbfH5LEBaHFnK6L4g=
- Openpgp: preference=signencrypt
Dear mailing list,
why are there invalid indices when using surface mesh? I have 2275
correct vertices in it. But somehow the mesh got 13637 vertices. Some of
may be invalid.
Lets have a look:
Data in mesh -> vpoints_ -> data:
[2] -0.532385 -2.32635 -0.1027
Data in my file:
Verts:
[0] -0.532385 -2.32635 -0.1027
Faces:
[0] 2 4 13273
The [0] 2 seems to refer to the internal mesh element address not to the
second good vertex which mesh.point(vd) delivers.
Strange why is the first vertex in my list the second in the mesh? Oh
this is a pattern. There seem to be 13637 vertices in mesh, but only
2275 good ones. You may ask why. Or why there is no offset, which would
correct for it when you write the data out. To be honest, it took me
some time find this out. How do I get the correct indices?
Here is some code.
std::to_string(mesh.number_of_vertices()); //2275
//2275 vertices, cool lets write them down to my debug file
for(Vertex_index vd : mesh.vertices())
{
const Point p(mesh.point(vd));
myfile << p.x() << " " << p.y() << " " << p.z() << std::endl;
}
//cool now i go over all faces, save the vertex indices and have my nice
mesh
for(auto it = faces.begin(); it != faces.end(); it++)
{
face_descriptor fd = *it;
HalfEdgeIndex edge = mesh.halfedge(fd);
Vertex_index vert1=source(edge, mesh);
Vertex_index vert2=source(next(edge, mesh), mesh);
Vertex_index vert3=source(next(next(edge, mesh), mesh), mesh);
//save them to tris
}
//lets write the triangles into a file, easy we have Vertex_indices,
right? Oh no, of course not. THIS IS CGAL (image this with king leonidas
voice)
for(size_t i = 0; i < tris.size(); i++)
{
myfile << tris[i] << std::endl; //and we got the wrong indices,
suprise!
}
- [cgal-discuss] Surface Mesh indices are invalid during manual export, Rash, 06/06/2019
- Re: [cgal-discuss] Surface Mesh indices are invalid during manual export, Sebastien Loriot (GeometryFactory), 06/07/2019
- Re: [cgal-discuss] Surface Mesh indices are invalid during manual export, Sebastien Loriot (GeometryFactory), 06/07/2019
- Re: [cgal-discuss] Surface Mesh indices are invalid during manual export, Sebastien Loriot (GeometryFactory), 06/07/2019
Archive powered by MHonArc 2.6.18.