#include <CGAL/Sphere_packing.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
using Mesh = CGAL::Surface_mesh<Point>;
namespace PMP = CGAL::Polygon_mesh_processing;
int main(int argc, const char **argv) {
Mesh mesh;
if (!PMP::IO::read_polygon_mesh(filename, mesh))
{
std::cerr << "Invalid input." << std::endl;
return 1;
}
std::vector<Sphere_3> spheres;
spheres.clear();
pack_spheres(mesh, std::back_inserter(spheres),
CGAL::parameters::number_of_spheres(1000).target_coverage(0.98f));
std::ofstream out("dino.spheres");
for (const auto& s : spheres)
out << s.center() <<
" " <<
CGAL::sqrt(s.squared_radius()) << std::endl;
out.close();
return 0;
}
std::string data_file_path(const std::string &filename)