Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3
- Date: Wed, 05 Sep 2012 07:07:32 +0200
- Organization: GeometryFactory
On 09/04/2012 05:24 PM, Mathieu Westphal wrote:
I have a polyhedron_3 (with only triangles in it ) and i want to createLooking at this page:
a vtkPolyData with it.
I can extract Points from the polyhedron without problem and inject them
into the vtkPolyData
However i see no evident way to extract cells (facets in CGAL?)
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Polyhedron_ref/Class_Polyhedron_3.htm
given a polyhefron Pyou can see that the range
P.facets_begin(), P.facets_end() is what you are looking for.
To access the vertices, given a facet f,
Halfedge_handle h=f.halhedge()
do{
h->vertex();//access the vertex
h->vertex()->point();//access the point
h=h->next();
}while (h!=f.halhedge());
To associate an id to each vertex you can use a std::map<Vertex_handle,unsigned> for example or use an
item class with id like Polyhedron_items_with_id_3.
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/BGL_ref/Class_Polyhedron_items_with_id_3.html
Sebastien.
vtkPolyData need for each cell, the id of constituing points.
Is there any way to find facets from one points? or points from one facet?
- [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3, Mathieu Westphal, 09/04/2012
- Re: [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3, Sebastien Loriot (GeometryFactory), 09/05/2012
- Re: [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3, Mathieu Westphal, 09/06/2012
- Re: [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3, Sebastien Loriot (GeometryFactory), 09/06/2012
- Re: [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3, Mathieu Westphal, 09/06/2012
- Re: [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3, Sebastien Loriot (GeometryFactory), 09/05/2012
Archive powered by MHonArc 2.6.18.