#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Extreme_points_traits_adapter_3.h>
#include <CGAL/convex_hull_3.h>
#include <CGAL/Convex_hull_3/distance.h>
#include <CGAL/Convex_hull_3/do_intersect.h>
#include <CGAL/Convex_hull_hierarchy_3.h>
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
#include <CGAL/IO/polygon_soup_io.h>
#include <vector>
#include <fstream>
typedef K::Point_3 Point_3;
typedef Mesh::Property_map<Mesh::Vertex_index, Point_3> PointMap;
int main(int argc, char* argv[])
{
const std::string f1 = (argc>1) ? argv[1] : CGAL::data_file_path("meshes/elephant.off");
const std::string f2 = (argc>2) ? argv[2] : CGAL::data_file_path("meshes/sphere.off");
Mesh sm1, sm2;
{
std::cerr<< "Cannot open " << f1 <<std::endl;
return 1;
}
{
std::cerr<< "Cannot open " << f2 <<std::endl;
return 1;
}
CGAL::parameters::point_map(sm1.points()),
CGAL::parameters::point_map(sm2.points()));
Convex_hull_hierarchy_3 hsm1(sm1);
Convex_hull_hierarchy_3 hsm2(sm2);
std::cout << "do convex hulls intersect? " << std::boolalpha << res << "\n";
return 0;
}
bool read_polygon_mesh(const std::string &fname, Graph &g, const NamedParameters &np=parameters::default_values())
bool do_intersect(const Convex_1 &ch1, const Convex_2 &ch2, const NamedParameters_1 &np1=parameters::default_values(), const NamedParameters_2 &np2=parameters::default_values())
checks whether two convex hulls intersect or not.
Definition: do_intersect.h:352
This class stores a convex hull in a data structure optimized for fast intersection tests.
Definition: Convex_hull_hierarchy_3.h:63