fix typos and headers

This commit is contained in:
Lingjie Zhu 2017-11-13 10:04:44 +08:00
parent 915adc5060
commit 60ebaf8348
8 changed files with 22 additions and 22 deletions

View File

@ -6,7 +6,7 @@
#include <CGAL/IO/Polyhedron_iostream.h> #include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h> #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/VSA_approximation.h> #include <CGAL/vsa_approximation.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

View File

@ -6,7 +6,7 @@
#include <CGAL/IO/Polyhedron_iostream.h> #include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h> #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/VSA_approximation.h> #include <CGAL/vsa_approximation.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

View File

@ -12,7 +12,7 @@ Named parameters allow the user to specify only those parameters which are reall
Assume a function `f()` that takes 3 parameters referred to as name, age and gender, and variables `n`, `a` and `g` to pass as parameters to that function. Without named parameters, we would call the function as `f(n,a,g)`, whereas with named parameters, we call it as `f(name(n).age(a).gender(g))`. Assume a function `f()` that takes 3 parameters referred to as name, age and gender, and variables `n`, `a` and `g` to pass as parameters to that function. Without named parameters, we would call the function as `f(n,a,g)`, whereas with named parameters, we call it as `f(name(n).age(a).gender(g))`.
More specifically, we give each parameter a name by wrapping it into a function whose name matches that of the parameter. The entire list of named parameters is a composition of function calls separated by a dot ( .). Thus, if the function takes a mix of mandatory and named parameters, we must use a comma to separate the last non-named parameter from the first named parameters, like this: More specifically, we give each parameter a name by wrapping it into a function whose name matches that of the parameter. The entire list of named parameters is a composition of function calls separated by a dot (.). Thus, if the function takes a mix of mandatory and named parameters, we must use a comma to separate the last non-named parameter from the first named parameters, like this:
`f(non_named_par0, non_named_par1, name(n).age(a).gender(g))` `f(non_named_par0, non_named_par1, name(n).age(a).gender(g))`

View File

@ -7,7 +7,7 @@ namespace CGAL {
\authors Pierre Alliez, Lingjie Zhu \authors Pierre Alliez, Lingjie Zhu
\cgalFigureBegin{Approximation_masque_main, masque_vsa.png} \cgalFigureBegin{Approximation_masque_main, masque_vsa.png}
Running the variational shape approximation on the mask model (62k triangles). Running the variational shape approximation on the mask model (62k triangles) with \f$ \mathcal{L}^{2,1} \f$ metric.
Left: partition with 100 planar proxies on the input surface. Left: partition with 100 planar proxies on the input surface.
Right: extracted triangle mesh with less than 250 triangles. Right: extracted triangle mesh with less than 250 triangles.
\cgalFigureEnd \cgalFigureEnd
@ -17,7 +17,7 @@ Right: extracted triangle mesh with less than 250 triangles.
For many applications ranging from geometry compression to reverse engineering, finding the concise and faithful approximation of an excessively verbose 3D data (in particular, scanned meshes) is beneficial for subsequent processing and may reduce the computational cost dramatically. For many applications ranging from geometry compression to reverse engineering, finding the concise and faithful approximation of an excessively verbose 3D data (in particular, scanned meshes) is beneficial for subsequent processing and may reduce the computational cost dramatically.
This package implements the <em>Variational Shape Approximation</em> \cgalCite{cgal:cad-vsa-04} (VSA) method to approximate an input surface mesh by a simpler triangle surface mesh or triangle soup. Given a triangulated surface mesh, referred to as <em>mesh</em> in the following, VSA leverages the Lloyd's iteration \cgalCite{cgal:l-lsqp-82} This package implements the <em>Variational Shape Approximation</em> \cgalCite{cgal:cad-vsa-04} (VSA) method to approximate an input surface mesh by a simpler triangle surface mesh or triangle soup. Given a triangulated surface mesh, referred to as <em>mesh</em> in the following, VSA leverages the Lloyd's iteration \cgalCite{cgal:l-lsqp-82}
to drive the approximation error down between the input surface triangle mesh and a set of geometric proxies. By default the proxies are planar, but the algorithm design is generic for future extensions to non-planar proxies. Two error metrics (L2, L2,1) are provided, but the algorithm is generic to other user-defined metrics. to drive the approximation error down between the input surface triangle mesh and a set of geometric proxies. By default the proxies are planar, but the algorithm design is generic for future extensions to non-planar proxies. Two error metrics (\f$ \mathcal{L}^2 \f$, \f$ \mathcal{L}^{2,1} \f$) are provided, but the algorithm is generic to other user-defined metrics.
An overview of the algorithm is provided in \ref sma_approximation. An overview of the algorithm is provided in \ref sma_approximation.
@ -66,7 +66,7 @@ Figure \cgalFigureRef{relaxation} depicts the Lloyd iteration on the plane-spher
Lloyd iterations on the plane-sphere model with the \f$ \mathcal{L}^{2,1} \f$ metric: (left) random initialization of 6 proxies; (center) after one iteration; (right) after 8 iterations, the regions settle. The red lines depict the proxy normals. Lloyd iterations on the plane-sphere model with the \f$ \mathcal{L}^{2,1} \f$ metric: (left) random initialization of 6 proxies; (center) after one iteration; (right) after 8 iterations, the regions settle. The red lines depict the proxy normals.
\cgalFigureEnd \cgalFigureEnd
The package provides both two metrics as `CGAL::L2Metric` and `CGAL::L21Metric`, respectively. The algorithm is not restricted to these two metrics and can be extended to other proxies and error metrics (see Section \ref sma_example3). The package provides both two metrics as `CGAL::L2Metric` and `CGAL::L21Metric`, respectively. The algorithm is not restricted to these two metrics and can be extended to other proxies and error metrics (see Section \ref sma_example3).
\subsection sma_init Initialization \subsection sma_init Initialization
@ -75,7 +75,7 @@ The package provides both two metrics as `CGAL::L2Metric` and `CGAL::L21Metric`,
The algorithm must be initialized by determining either the number of proxies required to approximate the geometry or the maximum tolerance approximation error. More specifically, we can decide: The algorithm must be initialized by determining either the number of proxies required to approximate the geometry or the maximum tolerance approximation error. More specifically, we can decide:
- <b>Target number of proxies</b>. The algorithm adds proxies until the specified target number is met. - <b>Target number of proxies</b>. The algorithm adds proxies until the specified target number is met.
- <b>Target error drop</b>. The algorithm adds proxies until the approximation error is lower than the specified target error. - <b>Target error drop</b>. The algorithm adds proxies until the approximation error is lower than the specified target error.
Several initialisation examples are provided in \cgalFigureRef{meshing}. Several initialization examples are provided in \cgalFigureRef{meshing}.
(TODO: precise whether drop refers to relative drop rate or absolute value) (TODO: precise whether drop refers to relative drop rate or absolute value)
@ -197,7 +197,7 @@ The following example uses the build-in `CGAL::L2Metric` to approximate the shap
Comparison of different metrics on the bear model, all with 200 proxies and hierarchical seeding. From left to right: \f$ \mathcal{L}^{2,1} \f$ metric, \f$ \mathcal{L}^2 \f$ metric and compact metric. Comparison of different metrics on the bear model, all with 200 proxies and hierarchical seeding. From left to right: \f$ \mathcal{L}^{2,1} \f$ metric, \f$ \mathcal{L}^2 \f$ metric and compact metric.
\cgalFigureEnd \cgalFigureEnd
The following example defines a point-wise proxy to achieves an isoptric patch approximation of the shape. The output mesh is depicted in Figure \cgalFigureRef{vsa_metric_comparison}. The following example defines a point-wise proxy to achieves an isotropic patch approximation of the shape. The output mesh is depicted in Figure \cgalFigureRef{vsa_metric_comparison}.
\cgalExample{Surface_mesh_approximation/vsa_metric_example.cpp} \cgalExample{Surface_mesh_approximation/vsa_metric_example.cpp}

View File

@ -6,7 +6,7 @@
#include <CGAL/IO/Polyhedron_iostream.h> #include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h> #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/VSA_approximation.h> #include <CGAL/vsa_approximation.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron; typedef CGAL::Polyhedron_3<Kernel> Polyhedron;

View File

@ -7,7 +7,7 @@
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h> #include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/property_map.h> #include <CGAL/property_map.h>
#include <CGAL/VSA_approximation.h> #include <CGAL/vsa_approximation.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT; typedef Kernel::FT FT;

View File

@ -521,11 +521,11 @@ public:
const Point_3 &p1 = point_pmap[target(he, *mesh)]; const Point_3 &p1 = point_pmap[target(he, *mesh)];
const Point_3 &p2 = point_pmap[target(next(he, *mesh), *mesh)]; const Point_3 &p2 = point_pmap[target(next(he, *mesh), *mesh)];
const FT sq_d0 = CGAL::squared_distance(p0, px.fit_plane); const FT sq_d0 = CGAL::squared_distance(p0, px.fit_plane);
const FT sq_d1 = CGAL::squared_distance(p1, px.fit_plane); const FT sq_d1 = CGAL::squared_distance(p1, px.fit_plane);
const FT sq_d2 = CGAL::squared_distance(p2, px.fit_plane); const FT sq_d2 = CGAL::squared_distance(p2, px.fit_plane);
const FT d0(std::sqrt(CGAL::to_double(sq_d0))); const FT d0(std::sqrt(CGAL::to_double(sq_d0)));
const FT d1(std::sqrt(CGAL::to_double(sq_d1))); const FT d1(std::sqrt(CGAL::to_double(sq_d1)));
const FT d2(std::sqrt(CGAL::to_double(sq_d2))); const FT d2(std::sqrt(CGAL::to_double(sq_d2)));
return (sq_d0 + sq_d1 + sq_d2 + d0 * d1 + d1 * d2 + d2 * d0) * area_pmap[f] / FT(6.0); return (sq_d0 + sq_d1 + sq_d2 + d0 * d1 + d1 * d2 + d2 * d0) * area_pmap[f] / FT(6.0);
} }
@ -579,12 +579,12 @@ public:
const Point_3 &p0 = point_pmap[source(he, *mesh)]; const Point_3 &p0 = point_pmap[source(he, *mesh)];
const Point_3 &p1 = point_pmap[target(he, *mesh)]; const Point_3 &p1 = point_pmap[target(he, *mesh)];
const Point_3 &p2 = point_pmap[target(next(he, *mesh), *mesh)]; const Point_3 &p2 = point_pmap[target(next(he, *mesh), *mesh)];
const FT sq_d0 = CGAL::squared_distance(p0, px.fit_plane); const FT sq_d0 = CGAL::squared_distance(p0, px.fit_plane);
const FT sq_d1 = CGAL::squared_distance(p1, px.fit_plane); const FT sq_d1 = CGAL::squared_distance(p1, px.fit_plane);
const FT sq_d2 = CGAL::squared_distance(p2, px.fit_plane); const FT sq_d2 = CGAL::squared_distance(p2, px.fit_plane);
const FT d0(std::sqrt(CGAL::to_double(sq_d0))); const FT d0(std::sqrt(CGAL::to_double(sq_d0)));
const FT d1(std::sqrt(CGAL::to_double(sq_d1))); const FT d1(std::sqrt(CGAL::to_double(sq_d1)));
const FT d2(std::sqrt(CGAL::to_double(sq_d2))); const FT d2(std::sqrt(CGAL::to_double(sq_d2)));
return (sq_d0 + sq_d1 + sq_d2 + d0 * d1 + d1 * d2 + d2 * d0) * area_pmap[f] / FT(6); return (sq_d0 + sq_d1 + sq_d2 + d0 * d1 + d1 * d2 + d2 * d0) * area_pmap[f] / FT(6);
} }