Keeping track of vertex IDs, is property_maps the right way? Surface Mesh #7727
Unanswered
MartensCedric
asked this question in
Q&A
Replies: 1 comment
-
There is indeed no guarantee that points added to the mesh are added in the same order in the mesh. I'm afraid there is no solution out of the box. You could generate a 3D triangulation like here to set the vertex indices corresponding to your input point. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have some code like this
If you notice carefully, I have added an
l
to my .obj output, which is a line. I have given some importance to the first N vertices.However, I have noticed that the order I obtain the vertices from sm.vertices() is different than the one I have specified at the beginning (the original vector of points). How can I keep track of vertex indices? I have found the page on property maps and I believe they might be useful to store the index of the points (See section 3: https://doc.cgal.org/latest/Point_set_3/index.html#Point_set_3_Usage).
However, I have had some difficulties on actually retrieving the index:
I am not terribly surprised that it fails since the point set might need to hash Point_3s
I found on this thread (https://stackoverflow.com/q/70582185/4048657) a comment mentioning: typedef CGAL::Polyhedron_3<Kernel,CGAL::Polyhedron_items_with_id_3> Polyhedron;
Which seems a bit similar to what I want but I think I need it for CGAL::Surface_mesh<Point_3>, and CGAL::Surface_mesh_items_with_id_3 doesnt seem to exist.
So I'm a bit confused on how I'm supposed to keep track of my vertex IDs
Beta Was this translation helpful? Give feedback.
All reactions