Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Convert Triangulation_2 object to Polyhedron_3
- Date: Wed, 14 Apr 2010 14:49:25 +0200
Hello Costas,
Costas Tsirogiannis wrote:
I am trying to find a "fast" way to do the following:A fast solution is to use the Polyhedron_incremental_builder.
Given an object t of type Triangulation_2 create a Polyhedron_3 which has
the same vertex and edge set
as t.
(http://www.cgal.org/Manual/last/doc_html/cgal_manual/Polyhedron_ref/Class_Polyhedron_incremental_builder_3.html)
Iterator over finite triangulation vertices to insert them in the
Polyhedron_incremental_builder (maintain a map<T2::Vertex*,unsigned> to
get the insertion order).
then iterate over triangulation finite facets and create facets using the map to get the vertex indices.
S.
Looking at the BGL interface for CGAL, I was thinking to use either the
copy_graph command with a custom
VertexCopier function or use the Boost DFS algorithm on the Triangulation
while handling the addition of edges
on the Polyhedron with a customized visitor. But I'm not sure if this is
supposed to work since there doesn't
seem to be some way to create a vertex in your target graph (here: the
Polyhedron) so that you can set any of the member values of this vertex (e.g. to enter the coordinates of the 3D
point associated with this vertex ).
- [cgal-discuss] Convert Triangulation_2 object to Polyhedron_3, Costas Tsirogiannis, 04/14/2010
- Re: [cgal-discuss] Convert Triangulation_2 object to Polyhedron_3, Sebastien Loriot (GeometryFactory), 04/14/2010
Archive powered by MHonArc 2.6.16.