Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] [CGAL NOOB] Extract Cell from polyhedron_3
- Date: Thu, 06 Sep 2012 18:34:10 +0200
- Organization: GeometryFactory
The following compiles on my machine.
Sebastien.
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polyhedron_3<K,CGAL::Polyhedron_items_with_id_3> Polyhedron;
int main()
{
std::vector<K::Point_3> points;
Polyhedron P;
CGAL::convex_hull_3(points.begin(),points.end(),P);
}
On 09/06/2012 11:54 AM, Mathieu Westphal wrote:
On 09/05/2012 07:07 AM, Sebastien Loriot (GeometryFactory) wrote:
On 09/04/2012 05:24 PM, Mathieu Westphal wrote:Thanks, everything works well, thanks to you !
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 anThe mesh generation fonction (CGAL::convex_hull_3) seem not to work with
item class with id likeClass_Polyhedron_items_with_id_3
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/BGL_ref/Class_Polyhedron_items_with_id_3.html
a Polyhedron_items_with_id_3
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.