#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Surface_mesh_approximation/approximate_triangle_mesh.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <iostream>
#include <fstream>
typedef boost::graph_traits<Mesh>::face_descriptor face_descriptor;
typedef Mesh::Property_map<face_descriptor, std::size_t> Face_proxy_pmap;
namespace VSA = CGAL::Surface_mesh_approximation;
int main(int argc, char** argv)
{
Mesh mesh;
{
std::cerr << "Invalid input file." << std::endl;
return EXIT_FAILURE;
}
std::vector<Kernel::Point_3> anchors;
std::vector<std::array<std::size_t, 3> > triangles;
Face_proxy_pmap fpxmap =
mesh.add_property_map<face_descriptor, std::size_t>("f:proxy_id", 0).first;
std::vector<Kernel::Vector_3> proxies;
VSA::approximate_triangle_mesh(mesh,
CGAL::parameters::min_error_drop(0.05).
number_of_iterations(40).
subdivision_ratio(0.3).
face_proxy_map(fpxmap).
proxies(std::back_inserter(proxies)).
anchors(std::back_inserter(anchors)).
triangles(std::back_inserter(triangles)));
return EXIT_SUCCESS;
}
bool read_polygon_mesh(const std::string &fname, PolygonMesh &g, const NamedParameters &np=parameters::default_values())
bool is_triangle_mesh(const FaceGraph &g)
std::string data_file_path(const std::string &filename)