-
Hi, I am new to CGAL 3d mesh generation, I have generated multi-domain mesh by using labeled images. I am quite interested in those vertices and facets on boundaries of different domains, and I have no idea about how to retrieve those indexes of these vertices. I have tried using boost::get(&(c3t3.index(vertex_handle)),however,it always return value 0. Any suggestions? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Your question is not precise enough. I guess you want to export the mesh to an index-based format, where CGAL meshes are pointer-based. The call You need to compute an indexing of the triangulation. You can have a look at the I/O functions of CGAL Mesh_3, in particular the function You can also have a look at the header file |
Beta Was this translation helpful? Give feedback.
Your question is not precise enough. I guess you want to export the mesh to an index-based format, where CGAL meshes are pointer-based. The call
c3t3.index(vertex_handle)
will not help you, because that is the index of the sub-domain that contains the point of the vertex.You need to compute an indexing of the triangulation. You can have a look at the I/O functions of CGAL Mesh_3, in particular the function
facets_in_complex_3_to_triangle_soup
in the fileinclude/CGAL/facets_in_complex_3_to_triangle_mesh.h
. You will see that the key of the indexing is a map of typeboost::unordered_map<Vertex_handle, std::size_t>
(as a complication, there is a special hash functor that is used to ensure d…