Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Convex Hull 3D. ( Reposted)
- Date: Wed, 30 Oct 2013 12:35:10 +0100
- Organization: GeometryFactory
The output to the polyhedron is triangulated and nef simplify planar facets probably.
The fact that facets are triangulated in the polyhedron is a bug.
I added it to my TODO list and will post the fix here when done.
Sebastien.
On 10/29/2013 08:52 PM, KeithSloan52 wrote:
I am new to CGAL and not really understanding, just following examples.
I am testing some code with a hull or two cubes.
When I try an iterate around the resulting facets, I just get facets with 3
vertex where as if I look at the same input data with OpenSCAD ( That uses
CGAL ) I see mostly facets with 4 vertex, so wondering what I am doing
wrong.
relevant sections of code are
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point_3;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef Polyhedron::Vertex_iterator Vertex_iterator;
typedef Polyhedron::Facet Facet;
typedef Polyhedron::Facet_iterator Facet_iterator;
typedef Polyhedron::Halfedge_handle Halfedge_handle;
typedef Polyhedron::Halfedge_around_facet_circulator
Halfedge_around_facet_circulator;
// Define Vector of Vertexes
std::vector<Point_3> points;
// define polyhedron to hold convex hull
//Polyhedron_3 poly;
Polyhedron poly;
// compute convex hull of non-collinear points
CGAL::convex_hull_3(points.begin(), points.end(), poly);
len = poly.size_of_vertices();
std::cout << "The convex hull contains " << len << " vertices" <<
std::endl;
Facet_iterator bfi = poly.facets_begin();
for ( ; bfi != poly.facets_end(); ++bfi)
{
cout << "Facet :" << endl;
Halfedge_around_facet_circulator j = bfi->facet_begin();
// Facets in polyhedral surfaces are at least triangles.
//CGAL_assertion( CGAL::circulator_size(j) >= 3);
//cout << "Start Vertex :" << j->vertex()-> point() << endl;
do {
cout << "Vertex : " << j->vertex()-> point() << endl;
} while ( ++j != bfi->facet_begin());
}
If I look at the code OpenSCAD is using, I see that they immediately convert
the polyhedron to a Nef polyhedron, but I don't understand the difference
between the two.
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Convex-Hull-3D-Reposted-tp4658329.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Convex Hull 3D. ( Reposted), KeithSloan52, 10/29/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), Sebastien Loriot (GeometryFactory), 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), KeithSloan52, 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), Marius Kintel, 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), Sebastien Loriot (GeometryFactory), 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), Marius Kintel, 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), Sebastien Loriot (GeometryFactory), 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), Marius Kintel, 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), KeithSloan52, 10/30/2013
- Re: [cgal-discuss] Convex Hull 3D. ( Reposted), Sebastien Loriot (GeometryFactory), 10/30/2013
Archive powered by MHonArc 2.6.18.