Skip to content

How to retrieve the index of vertex in CGAL_3D_MESH #6403

Answered by lrineau
blacksino asked this question in Q&A
Discussion options

You must be logged in to vote

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 file include/CGAL/facets_in_complex_3_to_triangle_mesh.h. You will see that the key of the indexing is a map of type boost::unordered_map<Vertex_handle, std::size_t> (as a complication, there is a special hash functor that is used to ensure d…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@blacksino
Comment options

@blacksino
Comment options

@blacksino
Comment options

@eudoxos
Comment options

Answer selected by MaelRL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #6401 on March 11, 2022 14:33.