Skip to Content.
Sympa Menu

cgal-discuss - Getting a vertex index from a Polyhedron_3

Subject: CGAL users discussion list

List archive

Getting a vertex index from a Polyhedron_3


Chronological Thread 
  • From: Richard Southern <>
  • To:
  • Subject: Getting a vertex index from a Polyhedron_3
  • Date: Thu, 24 Apr 2008 16:16:38 +0100

Hi there,

<This is my first posting, so apologies if I'm not giving you all the necessary info.
I'm using CGAL 3.3.1 on 32 & 64 bit Linux platforms, gcc 4.1.2 mostly.>

I've got a problem with a mesh that I am modifying using a custom geometric operation (not covered
by the split / fill_hole type operations provided in Polyhedron_3). Basically I would like to remove
a subset of faces and replace them with an alternative triangulation without having to rebuild the
entire mesh from scratch.

For this, the best thing appears to be to firstly use Polyhedron_3::erase_facet to get rid of facets to
be replaced, and thereafter to use the Polyhedron_incremental_builder_3 with ABSOLUTE_INDEXING
to create new facets and vertices to fill the hole.

Unfortunately I see no obvious way to get the integer index of a vertex in the original mesh from a
Vertex_handle, so there is no way that new faces will be stitched together consistently.

Interestingly there is a function which appears to do the opposite:
/"Vertex_handle / / B.vertex ( std::size_t i) / returns handle for the vertex of index /i/, or /Vertex_handle/ if there is no /i/-th vertex."

So:
- Is there a way to get the integer index of a vertex in a mesh that has already been constructed given a
Vertex_handle?

- Is this approach going to work in general?

- Is there a better way to do it?

Thanks a bunch,
- Richard




Archive powered by MHonArc 2.6.16.

Top of Page