#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/compute_average_spacing.h>
#include <CGAL/pca_estimate_normals.h>
#include <CGAL/mst_orient_normals.h>
#include <CGAL/property_map.h>
#include <CGAL/IO/read_points.h>
#include <utility>
#include <list>
#include <fstream>
typedef std::pair<Point, Vector> PointVectorPair;
int main(int argc, char*argv[])
{
std::list<PointVectorPair> points;
std::back_inserter(points),
{
std::cerr << "Error: cannot read file " << fname<< std::endl;
return EXIT_FAILURE;
}
const int nb_neighbors = 18;
if (argc > 2 && std::strcmp(argv[2], "-r") == 0)
{
double spacing
(points, nb_neighbors,
(points,
0,
.neighbor_radius(2. * spacing));
}
else
{
(points, nb_neighbors,
}
std::list<PointVectorPair>::iterator unoriented_points_begin =
points.erase(unoriented_points_begin, points.end());
return EXIT_SUCCESS;
}
PointRange::iterator mst_orient_normals(PointRange &points, unsigned int k, const NamedParameters &np=parameters::default_values())
Orients the normals of the range of points using the propagation of a seed orientation through a mini...
Definition mst_orient_normals.h:610
void pca_estimate_normals(PointRange &points, unsigned int k, const NamedParameters &np=parameters::default_values())
Estimates normal directions of the range of points by linear least squares fitting of a plane over th...
Definition pca_estimate_normals.h:154
FT compute_average_spacing(const PointRange &points, unsigned int k, const NamedParameters &np=parameters::default_values())
Computes average spacing from k nearest neighbors.
Definition compute_average_spacing.h:154
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
std::string data_file_path(const std::string &filename)