From 46a035df4ec8bf64eb5ca5adacf91aea7caa6f3c Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Wed, 29 Apr 2009 15:23:47 +0000 Subject: [PATCH] point set processing: more on user ref --- .../Point_set_processing_3/normals.tex | 24 ++++++++----------- .../Point_set_processing_3/smoothing.tex | 3 +-- .../jet_smoothing_example.cpp | 18 +++++++------- ...ormals_example.cpp => normals_example.cpp} | 0 4 files changed, 20 insertions(+), 25 deletions(-) rename Point_set_processing_3/examples/Point_set_processing_3/{pca_estimate_normals_example.cpp => normals_example.cpp} (100%) diff --git a/Point_set_processing_3/doc_tex/Point_set_processing_3/normals.tex b/Point_set_processing_3/doc_tex/Point_set_processing_3/normals.tex index f941f27e7c4..290019c092a 100644 --- a/Point_set_processing_3/doc_tex/Point_set_processing_3/normals.tex +++ b/Point_set_processing_3/doc_tex/Point_set_processing_3/normals.tex @@ -1,15 +1,13 @@ \section{Normal Estimation} -Two functions are provided to estimate the normal direction of the inferred surface at each point from the input point set. In both cases, the result is an unoriented normal vector for each input point. +Two functions are provided to estimate the normal direction of the inferred surface at each point af an input point set. In both cases the result is an unoriented normal vector for each input point. -Function \ccc{CGAL::jet_estimate_normals()} estimates the normal direction at each point from the set by fitting a jet surface over its $k$ nearest neighbors. The default jet is a quadric surface.\\ -This algorithm is well suited to point sets scattered over curved surfaces. +Function \ccc{CGAL::jet_estimate_normals()} estimates the normal direction at each point from the input set by fitting a jet surface over its $k$ nearest neighbors. The default jet is a quadric surface. This algorithm is well suited to point sets scattered over curved surfaces. -Function \ccc{CGAL::pca_estimate_normals()} estimates the normal direction at each point from the set by linear least squares fitting of a plane over its $k$ nearest neighbors.\\ -This algorithm is well suited to point sets scattered over plane surfaces. It is much faster than \ccc{CGAL::jet_estimate_normals()}. +Function \ccc{CGAL::pca_estimate_normals()} estimates the normal direction at each point from the set by linear least squares fitting of a plane over its $k$ nearest neighbors. This algorithm is simpler and faster than \ccc{CGAL::jet_estimate_normals()}. -\ccRefIdfierPage{CGAL::pca_estimate_normals} \\ \ccRefIdfierPage{CGAL::jet_estimate_normals} \\ +\ccRefIdfierPage{CGAL::pca_estimate_normals} \\ % % Insert image pca_estimate_normals.jpg/eps % \begin{center} @@ -27,14 +25,9 @@ This algorithm is well suited to point sets scattered over plane surfaces. It is % \end{figure} % \end{center} -Example: - -\ccIncludeExampleCode{Point_set_processing_3/pca_estimate_normals_example.cpp} - - \section{Normal Orientation} -Function \ccc{CGAL::mst_orient_normals()} orients the normals of a set of points with (unoriented) normals using the method described by Hoppe et al. in {\em Surface reconstruction from unorganized points} \cite{cgal:hddms-srup-92}. More specifically, this method constructs a Riemannian graph over the input points and propagates a seed normal orientation within a minimum spanning tree computed over the graph with the Boost graph library. The result is an oriented normal vector for each input point/normal. +Function \ccc{CGAL::mst_orient_normals()} orients the normals of a set of points with unoriented normals using the method described by Hoppe et al. in \emph{Surface reconstruction from unorganized points} \cite{cgal:hddms-srup-92}. More specifically, this method constructs a Riemannian graph over the input points (the graph of the $K$ nearest neighbor points) and propagates a seed normal orientation within a minimum spanning tree computed over the graph with the Boost graph library. The result is an oriented normal vector for each input point with normal. \ccRefIdfierPage{CGAL::mst_orient_normals} \\ @@ -50,10 +43,13 @@ Function \ccc{CGAL::mst_orient_normals()} orients the normals of a set of points \end{ccHtmlOnly} % Title \begin{figure}[h] - \caption{Normal orientation of a cube's normals. Notice the left and bottom normals orientation.} + \caption{Normal orientation of a sampled cube surface. + Left: unoriented normals. + Right: oriented normals.} \end{figure} \end{center} -Example: see \ccc{pca_estimate_normals_example.cpp} example above. +The following example reads a point set from a file, estimates the normals through PCA over the 7 nearest neighbors and orient the normals: +\ccIncludeExampleCode{Point_set_processing_3/normals_example.cpp} diff --git a/Point_set_processing_3/doc_tex/Point_set_processing_3/smoothing.tex b/Point_set_processing_3/doc_tex/Point_set_processing_3/smoothing.tex index 164a6db6413..b59d7c3e32b 100644 --- a/Point_set_processing_3/doc_tex/Point_set_processing_3/smoothing.tex +++ b/Point_set_processing_3/doc_tex/Point_set_processing_3/smoothing.tex @@ -18,6 +18,5 @@ Function \ccRefIdfierPage{CGAL::jet_smooth_point_set} smoothes the input point s % \end{figure} % \end{center} -Example: - +The following example generates a set of 9 points close to the $xy$ plane and smoothes them using the 8 nearest neighbors: \ccIncludeExampleCode{Point_set_processing_3/jet_smoothing_example.cpp} diff --git a/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp index b648a3a254d..60cb8503b50 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp +++ b/Point_set_processing_3/examples/Point_set_processing_3/jet_smoothing_example.cpp @@ -10,15 +10,15 @@ int main(void) { // generate point set std::deque points; - points.push_back(Point( 0.0, 0.0, 0.01)); - points.push_back(Point(-0.1,-0.1, 0.02)); - points.push_back(Point(-0.1,-0.2, 0.01)); - points.push_back(Point(-0.1, 0.1, 0.02)); - points.push_back(Point( 0.1,-0.1, 0.00)); - points.push_back(Point( 0.1, 0.2, 0.01)); - points.push_back(Point( 0.2, 0.0, 0.02)); - points.push_back(Point( 0.2, 0.1, 0.00)); - points.push_back(Point( 0.0,-0.1, 0.01)); + points.push_back(Point( 0.0, 0.0, 0.001)); + points.push_back(Point(-0.1,-0.1, 0.002)); + points.push_back(Point(-0.1,-0.2, 0.001)); + points.push_back(Point(-0.1, 0.1, 0.002)); + points.push_back(Point( 0.1,-0.1, 0.000)); + points.push_back(Point( 0.1, 0.2, 0.001)); + points.push_back(Point( 0.2, 0.0, 0.002)); + points.push_back(Point( 0.2, 0.1, 0.000)); + points.push_back(Point( 0.0,-0.1, 0.001)); // smoothing const unsigned int nb_neighbors = 8; diff --git a/Point_set_processing_3/examples/Point_set_processing_3/pca_estimate_normals_example.cpp b/Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp similarity index 100% rename from Point_set_processing_3/examples/Point_set_processing_3/pca_estimate_normals_example.cpp rename to Point_set_processing_3/examples/Point_set_processing_3/normals_example.cpp