#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/grid_simplify_point_set.h>
#include <CGAL/IO/read_points.h>
#include <vector>
#include <fstream>
int main(int argc, char*argv[])
{
const std::string fname = (argc>1) ? argv[1] : CGAL::data_file_path("points_3/oni.pwn");
std::vector<Point> points;
{
std::cerr << "Error: cannot read file " << fname << std::endl;
return EXIT_FAILURE;
}
double cell_size = 0.03;
unsigned int min_points_per_cell = 3;
auto iterator_to_first_to_remove
(points, cell_size,
CGAL::parameters::min_points_per_cell(min_points_per_cell));
points.erase(iterator_to_first_to_remove, points.end());
points.shrink_to_fit();
return EXIT_SUCCESS;
}
PointRange::iterator grid_simplify_point_set(PointRange &points, double epsilon, const NamedParameters &np=parameters::default_values())
Merges points which belong to the same cell of a grid of cell size = epsilon.
Definition: grid_simplify_point_set.h:235
bool read_points(const std::string &fname, PointOutputIterator output, const NamedParameters &np=parameters::default_values())
reads the point set from an input file.
Definition: read_points.h:89