#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Variational_shape_approximation.h>
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
#include <iostream>
#include <fstream>
typedef boost::property_map<Mesh, boost::vertex_point_t>::type Vertex_point_map;
typedef Mesh_approximation::Error_metric L21_metric;
int main(int argc, char** argv)
{
Mesh mesh;
{
std::cerr << "Invalid input file." << std::endl;
return EXIT_FAILURE;
}
Vertex_point_map vpmap = get(boost::vertex_point, const_cast<Mesh &>(mesh));
L21_metric error_metric(mesh, vpmap);
Mesh_approximation approx(mesh, vpmap, error_metric);
approx.initialize_seeds(CGAL::parameters::seeding_method(
VSA::RANDOM)
.max_number_of_proxies(100));
approx.run(30);
approx.add_to_furthest_proxies(3, 5);
approx.run(10);
approx.teleport_proxies(2, 5);
approx.run(10);
std::vector<Kernel::Point_3> anchors;
std::vector<std::array<std::size_t, 3> > triangles;
approx.output(CGAL::parameters::anchors(std::back_inserter(anchors)).
triangles(std::back_inserter(triangles)));
return EXIT_SUCCESS;
}