#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/point_generators_3.h>
#include <CGAL/algorithm.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/convex_hull_3.h>
#include <vector>
typedef K::Segment_3 Segment_3;
typedef K::Point_3 Point_3;
struct Plane_from_facet {
Polyhedron_3::Plane_3 operator()(Polyhedron_3::Facet& f) {
Polyhedron_3::Halfedge_handle h = f.halfedge();
return Polyhedron_3::Plane_3( h->vertex()->point(),
h->next()->vertex()->point(),
h->opposite()->vertex()->point());
}
};
int main()
{
CGAL::Random_points_in_sphere_3<Point_3, PointCreator> gen(100.0);
std::vector<Point_3> points;
Polyhedron_3 poly;
std::cout << "The convex hull contains " << poly.size_of_vertices() << " vertices" << std::endl;
std::transform( poly.facets_begin(), poly.facets_end(), poly.planes_begin(),Plane_from_facet());
return 0;
}