#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/mesh_segmentation.h>
#include <CGAL/property_map.h>
#include <iostream>
#include <fstream>
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef boost::graph_traits<Polyhedron>::face_descriptor face_descriptor;
int main()
{
Polyhedron mesh;
{
std::cerr << "Input is not a triangle mesh" << std::endl;
return EXIT_FAILURE;
}
typedef std::map<face_descriptor, double> Face_double_map;
Face_double_map internal_map;
boost::associative_property_map<Face_double_map> sdf_property_map(internal_map);
std::pair<double, double> min_max_sdf =
CGAL::sdf_values(mesh, sdf_property_map);
std::cout << "minimum SDF: " << min_max_sdf.first
<< " maximum SDF: " << min_max_sdf.second << std::endl;
for(face_descriptor f : faces(mesh))
std::cout << sdf_property_map[f] << " ";
std::cout << std::endl;
return EXIT_SUCCESS;
}
bool is_triangle_mesh(const FaceGraph &g)
std::pair< double, double > sdf_values(const TriangleMesh &triangle_mesh, SDFPropertyMap sdf_values_map, double cone_angle=2.0/3.0 *CGAL_PI, std::size_t number_of_rays=25, bool postprocess=true, PointPropertyMap ppmap=PointPropertyMap(), GeomTraits traits=GeomTraits())
Function computing the Shape Diameter Function over a surface mesh.
Definition: mesh_segmentation.h:96
std::string data_file_path(const std::string &filename)