You can use a vertex type with id like:

typedef CGAL::Polyhedron_3<Kernel, CGAL::Polyhedron_items_with_id_3>

Polyhedron_3;

https://doc.cgal.org/latest/BGL/classCGAL_1_1Polyhedron__items__with__id__3.htmlIn particular with this type, any face/vertex/face handle has a id()

field that can be set and access:

vh->id()=33;

std::cout << vh->id() << "\n";

Another option is to use the class Surface_mesh that have descriptor

being index (not necessarily contiguous if some removal were done and

collect_garbage() has not been called).

https://doc.cgal.org/latest/Surface_mesh/Sebastien.

On 2/26/19 5:50 AM, Robert Sage wrote:

> Hello,

> We need to convert Polyhedron_3 facet vertices from Vertex_handle to

> integer ids exactly like I see in:

>

https://doc.cgal.org/latest/Polyhedron/Polyhedron_2polyhedron_prog_off_8cpp-example.html> So we have adapted this code but are observing each std::distance

> operation runs at O(n) and thus the whole conversion takes a long time

> for Polyhedron with many facets. Is there a more efficient way?

> Thank you!

> Robert

--

You are currently subscribed to cgal-discuss.

To unsubscribe or access the archives, go to

https://sympa.inria.fr/sympa/info/cgal-discuss