From 3d6cf832754c20a3a73ed96d9c6028957b84e07c Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Fri, 25 Sep 2015 15:47:50 +0200 Subject: [PATCH] Discussion on scale space and output --- .../Tutorials/Tutorial_reconstruction.txt | 54 +++++++++++++++++-- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/Documentation/doc/Documentation/Tutorials/Tutorial_reconstruction.txt b/Documentation/doc/Documentation/Tutorials/Tutorial_reconstruction.txt index ea75ad98811..9f503d2178c 100644 --- a/Documentation/doc/Documentation/Tutorials/Tutorial_reconstruction.txt +++ b/Documentation/doc/Documentation/Tutorials/Tutorial_reconstruction.txt @@ -306,7 +306,9 @@ surfaces with boundaries: contrary to Poisson, it does not require normals and is not bound to reconstruct closed shapes. However, it requires preprocessing if the point is noisy. -Here is an example on how to call this function: +The \ref Chapter_Advancing_Front_Surface_Reconstruction "Advancing Front" +package provides several ways of constructing the function. Here is +a simple example: \code{.cpp} typedef CGAL::cpp11::array Facet; // Triple of indices @@ -318,7 +320,27 @@ CGAL::advancing_front_surface_reconstruction(points.begin(), \subsection TutorialsReconstruction_reconstruction_scale_space Scale Space -\todo Tutorial +Scale space reconstruction aims at producing a surface that +interpolates the input points (interpolant) while offering some +robustness to noise. It is the good choice if the input point cloud is +noisy but the user still wants the surface to pass exactly through the +points. + +Notice that although there is an option to force the output to be +manifold, it is not guaranted to be orientable (contrary to _Poisson_ +and _Avdancing front_). + +\code{.cpp} +CGAL::Scale_space_surface_receonstruction_3 reconstruct + (10, // Number of neighborhood points + 300); // Number of samples used to estimate neighborhood radius + +reconstruct.reconstruct_surface(points.begin (), points.end (), + 4, // Number of iterations + false, // Do not separate connected components + true); // Force manifold output +\endcode + \section TutorialsReconstruction_postprocessing Output and Postprocessing @@ -334,17 +356,39 @@ user's expectations on the output mesh. The mesh (postprocessed or not) can easily be saved in the OFF format: \code{.cpp} -\\ Poisson +// Poisson std::ofstream f ("out.off"); CGAL::output_facet_to_off(f, c2t3); +f.close (); \endcode \code{.cpp} -\\ Advancing Front +// Advancing Front +std::ofstream f ("out.off"); +f << "OFF" << std::endl << points.size () << " " << facets.size () << " 0" << std::end; + +for (std::size_t i = 0; i < points.size (); ++ i) + f << points[i] << std::endl; + +for (std::size_t i = 0; i < facets.size (); ++ j) + f << "3 " << facets[i] << std::endl; + +f.close (); \endcode \code{.cpp} -\\ Advancing Front +// Scale space +std::ofstream f ("out.off"); +f << "OFF" << std::endl << points.size () << " " << facets.size () << " 0" << std::end; + +for (std::size_t i = 0; i < points.size (); ++ i) + f << points[i] << std::endl; + +typedef typename Scale_space_surface_reconstruction_3::Triple_iterator Triple_iterator; +for (Triple_iterator it = reconstruct.shell_begin (shell); it != reconstruct.shell_end (shell); ++it) + out << "3 "<< *it << std::endl; + +f.close (); \endcode \section TutorialsReconstruction_recap Recap and Full Code Example