#include <CGAL/Scale_space_surface_reconstruction_3.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/IO/read_points.h>
#include <CGAL/IO/OFF.h>
#include <algorithm>
#include <fstream>
#include <iostream>
typedef Reconstruction::Point Point;
typedef Reconstruction::Facet_const_iterator Facet_iterator;
int main(int argc, char* argv[])
{
std::cout << "Reading " << std::flush;
std::vector<Point> points;
{
std::cerr << "Error: cannot read file" << std::endl;
return EXIT_FAILURE;
}
std::cout << "done: " << points.size() << " points." << std::endl;
Reconstruction reconstruct;
reconstruct.insert( points.begin(), points.end() );
for (std::size_t i = 0; i < 2; ++ i)
{
Smoother smoother( 10, 100 );
reconstruct.increase_scale( 2, smoother );
std::cout << "Neighborhood squared radius is "
<< smoother.squared_radius() << std::endl;
Mesher mesher (smoother.squared_radius());
reconstruct.reconstruct_surface(mesher);
if (i == 0)
{
std::cout << "First reconstruction done." << std::endl;
reconstruct.points(),
reconstruct.facets(),
CGAL::parameters::stream_precision(17));
}
else
{
std::cout << "Second reconstruction done." << std::endl;
reconstruct.points(),
reconstruct.facets(),
CGAL::parameters::stream_precision(17));
}
}
std::cout << "Reconstructions are ready to be examined in your favorite viewer" << std::endl;
return EXIT_SUCCESS;
}