Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Convert Polyhedron_3 Vertex_handles to integers

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Convert Polyhedron_3 Vertex_handles to integers


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Convert Polyhedron_3 Vertex_handles to integers
  • Date: Tue, 26 Feb 2019 08:45:06 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:YPgi6xYOWeJ3tR+Iz2BCH4D/LSx+4OfEezUN459isYplN5qZr8i5bnLW6fgltlLVR4KTs6sC17KG9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCa+bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD0fOjAk7m/XhMx+gqFVrh2vqBNwwZLbbo6OOfpifK7QZ88WSXZPU8tTUSFKH4Oyb5EID+oEJetUoZTzqEUVohSkHgmsGOLvxSFOhnTr26M61P4hEQDB3Aw8AtkCtHXao8vyNKcXT++10LPIzDXDYfxMxTj99I/IcgohoP2JU757bM3cyVIrFwPClFWQqIvlPy+P2uQIt2iW9OVgVee1hG4mrwF9uCSgxsApioTQgI8e117K9SJ8wIkvJN24TlZ2bsKrEJRKsyGWLYx2QtktQ2xupS00yaUGtIalcCQWzJkr3R3SZvydf4SV/B7uV/ydLDdliH59er+yhAy+/Vavx+D9TMW4zVJHoyRfntTOtn0A0QHY5NKdRftn5Eih3C6C1wDN5eFAJkA5ja/bJIQgwr40j5YSv0HDEjLvlEX4jKKaa18o+uev6+TgbbXmooGTO5VohQH5N6Qigs2/AeImPQgSR2WX5/iw2bn58UD6QLhGlOA6nrfavZzAJckXu7a1AwpP3YYi7xa/AS2m0NMdnXQfN1JFfBWHj5LoO1HJPPD0F/K/g1C3nTdkwvDJJLzhApHXInffl7fheK5x61RAxwor0dBf+5VUB6kdL/L8QEDxsMXUAQI4Mwyv3+nnFc591pgFVGKUAq6ZNbvSvkWS6uIuJemMfo4VtyznJ/gr/f69xUM+zFQSdK3s0ZoMY22jBdxnJV+YaDzimIQvC2AP60AFQebjk0GDXDgbQ3GoXqUgrnEUBYWjAJvZV66ki6CGxjb6VNUCfWRBEFGLDTHtc62LXv4NbGSZJco3wW9MbqSoV4J0jULmjwT90bcydrOFqB1djorq0Z1O38OWkBgz8TJuCMHEijOCSmh1miUDQDpkhfkj83w48U+K1O1Du9IdDcZavqobXQIzNJqaxOt/WYirB1DxO+yRQVPjee2IRDE8StVrno0Lakd5Xsqn11XNgnPsDLgSmLiGQpcz9/CE0g==

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.html
In 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



Archive powered by MHonArc 2.6.18.

Top of Page