mirror of https://github.com/CGAL/cgal
parent
183a092e6b
commit
f5696aca49
|
|
@ -26,7 +26,7 @@ See below a sample call of a function that uses the optional BGL named parameter
|
||||||
// anchors: output anchor points
|
// anchors: output anchor points
|
||||||
// triangles: output triplets of indexed triangles
|
// triangles: output triplets of indexed triangles
|
||||||
|
|
||||||
CGAL::mesh_approximation(tm,
|
CGAL::approximate_mesh(tm,
|
||||||
CGAL::Surface_mesh_approximation::parameters::seeding_method(method).
|
CGAL::Surface_mesh_approximation::parameters::seeding_method(method).
|
||||||
max_nb_proxies(nb_proxies).
|
max_nb_proxies(nb_proxies).
|
||||||
nb_of_iterations(nb_iterations).
|
nb_of_iterations(nb_iterations).
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ and provides the list of parameters used in this package.
|
||||||
- `ErrorMetricProxy`
|
- `ErrorMetricProxy`
|
||||||
|
|
||||||
## Main Functions ##
|
## Main Functions ##
|
||||||
- `CGAL::mesh_approximation()`
|
- `CGAL::approximate_mesh()`
|
||||||
|
|
||||||
## Classes ##
|
## Classes ##
|
||||||
- `CGAL::VSA::L21_metric_vector_proxy`
|
- `CGAL::VSA::L21_metric_vector_proxy`
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ The approximation error is one-sided, defined between the clusters and their ass
|
||||||
Variational shape approximation on two models with the \f$ \mathcal{L}^{2,1} \f$ error metric and planar proxies. From left to right: partition of the input surface triangle mesh, anchor vertices and edges, and output triangle mesh. The partition is optimized via discrete clustering of the input triangles, so as to minimize the approximation error from the clusters to the planar proxies (not shown).
|
Variational shape approximation on two models with the \f$ \mathcal{L}^{2,1} \f$ error metric and planar proxies. From left to right: partition of the input surface triangle mesh, anchor vertices and edges, and output triangle mesh. The partition is optimized via discrete clustering of the input triangles, so as to minimize the approximation error from the clusters to the planar proxies (not shown).
|
||||||
\cgalFigureEnd
|
\cgalFigureEnd
|
||||||
|
|
||||||
This package offers both the approximation and mesh construction functionalities, through the free function `CGAL::mesh_approximation()` which runs a fully automated version of the algorithm:
|
This package offers both the approximation and mesh construction functionalities, through the free function `CGAL::approximate_mesh()` which runs a fully automated version of the algorithm:
|
||||||
\cgalExample{Surface_mesh_approximation/vsa_simple_approximation_example.cpp}
|
\cgalExample{Surface_mesh_approximation/vsa_simple_approximation_example.cpp}
|
||||||
|
|
||||||
A class interface is also provided for advanced users, in which a series of pliant operators offer interactive capabilities during clustering and customization in terms of error and proxies.
|
A class interface is also provided for advanced users, in which a series of pliant operators offer interactive capabilities during clustering and customization in terms of error and proxies.
|
||||||
|
|
@ -161,7 +161,7 @@ As there is no guarantee that the output mesh is 2-manifold and oriented, the ma
|
||||||
This package can be used with any class model of the concept `FaceListGraph` described in \ref PkgBGL "CGAL and the Boost Graph Library".
|
This package can be used with any class model of the concept `FaceListGraph` described in \ref PkgBGL "CGAL and the Boost Graph Library".
|
||||||
|
|
||||||
Free function with \ref namedparameters options.
|
Free function with \ref namedparameters options.
|
||||||
- `CGAL::mesh_approximation()`: given a triangle mesh, approximate the geometry with default \f$ \mathcal{L}^{2,1} \f$ metric.
|
- `CGAL::approximate_mesh()`: given a triangle mesh, approximate the geometry with default \f$ \mathcal{L}^{2,1} \f$ metric.
|
||||||
|
|
||||||
Class interface:
|
Class interface:
|
||||||
- `CGAL::Variational_shape_approximation`: allowing more customization of the proxy, metric and approximation process.
|
- `CGAL::Variational_shape_approximation`: allowing more customization of the proxy, metric and approximation process.
|
||||||
|
|
@ -174,7 +174,7 @@ The input of the algorithm is expected to be:
|
||||||
|
|
||||||
\subsection sma_example1 Free Function Approximation
|
\subsection sma_example1 Free Function Approximation
|
||||||
|
|
||||||
The following example calls the free function `CGAL::mesh_approximation()` on the input triangle mesh with default `CGAL::VSA::L21_metric_vector_proxy`.
|
The following example calls the free function `CGAL::approximate_mesh()` on the input triangle mesh with default `CGAL::VSA::L21_metric_vector_proxy`.
|
||||||
|
|
||||||
\cgalExample{Surface_mesh_approximation/vsa_approximation_example.cpp}
|
\cgalExample{Surface_mesh_approximation/vsa_approximation_example.cpp}
|
||||||
|
|
||||||
|
|
@ -208,7 +208,7 @@ The following example defines a point-wise proxy to yield an isotropic approxima
|
||||||
|
|
||||||
\section sma_perf Performances
|
\section sma_perf Performances
|
||||||
|
|
||||||
We provide some performance comparisons with the free function API `CGAL::mesh_approximation`.
|
We provide some performance comparisons with the free function API `CGAL::approximate_mesh`.
|
||||||
Timings are recorded on a PC running Windows10 X64 with an Intel Xeon E5-1620 clocked at 3.70 GHz with 32GB of RAM.
|
Timings are recorded on a PC running Windows10 X64 with an Intel Xeon E5-1620 clocked at 3.70 GHz with 32GB of RAM.
|
||||||
The program has been optimized with the O2 option with Visual Studio 2015. By default the kernel used is `Exact_predicates_inexact_constructions_kernel` (`EPICK`).
|
The program has been optimized with the O2 option with Visual Studio 2015. By default the kernel used is `Exact_predicates_inexact_constructions_kernel` (`EPICK`).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/mesh_approximation.h>
|
#include <CGAL/approximate_mesh.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;
|
||||||
|
|
@ -32,7 +32,7 @@ int main()
|
||||||
std::vector<Kernel::Vector_3> proxies;
|
std::vector<Kernel::Vector_3> proxies;
|
||||||
|
|
||||||
// free function interface with named parameters
|
// free function interface with named parameters
|
||||||
CGAL::mesh_approximation(input,
|
CGAL::approximate_mesh(input,
|
||||||
CGAL::Surface_mesh_approximation::parameters::min_error_drop(0.05). // seeding with minimum error drop
|
CGAL::Surface_mesh_approximation::parameters::min_error_drop(0.05). // seeding with minimum error drop
|
||||||
nb_of_iterations(40). // set number of clustering iterations after seeding
|
nb_of_iterations(40). // set number of clustering iterations after seeding
|
||||||
subdivision_ratio(0.3). // set chord subdivision ratio threshold when meshing
|
subdivision_ratio(0.3). // set chord subdivision ratio threshold when meshing
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/mesh_approximation.h>
|
#include <CGAL/approximate_mesh.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;
|
||||||
|
|
@ -20,7 +20,7 @@ int main()
|
||||||
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles; // triplets of indices
|
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles; // triplets of indices
|
||||||
|
|
||||||
// free function interface with named parameters
|
// free function interface with named parameters
|
||||||
bool is_manifold = CGAL::mesh_approximation(input,
|
bool is_manifold = CGAL::approximate_mesh(input,
|
||||||
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
|
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
|
||||||
max_nb_proxies(200). // seeding with maximum number of proxies
|
max_nb_proxies(200). // seeding with maximum number of proxies
|
||||||
nb_of_iterations(30). // number of clustering iterations after seeding
|
nb_of_iterations(30). // number of clustering iterations after seeding
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/mesh_approximation.h>
|
#include <CGAL/approximate_mesh.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;
|
||||||
|
|
@ -26,7 +26,7 @@ int main()
|
||||||
Facet_proxy_pmap fpxmap(fidx_map);
|
Facet_proxy_pmap fpxmap(fidx_map);
|
||||||
|
|
||||||
// free function interface with named parameters
|
// free function interface with named parameters
|
||||||
CGAL::mesh_approximation(input,
|
CGAL::approximate_mesh(input,
|
||||||
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(200). // first stop criterion
|
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(200). // first stop criterion
|
||||||
min_error_drop(0.05). // second stop criterion
|
min_error_drop(0.05). // second stop criterion
|
||||||
nb_of_iterations(30). // number of relaxation iterations after seeding
|
nb_of_iterations(30). // number of relaxation iterations after seeding
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/mesh_approximation.h>
|
#include <CGAL/approximate_mesh.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;
|
||||||
|
|
@ -20,7 +20,7 @@ int main()
|
||||||
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles;
|
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles;
|
||||||
|
|
||||||
// free function interface with named parameters
|
// free function interface with named parameters
|
||||||
CGAL::mesh_approximation(input,
|
CGAL::approximate_mesh(input,
|
||||||
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(200).
|
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(200).
|
||||||
anchors(std::back_inserter(anchors)). // anchor points
|
anchors(std::back_inserter(anchors)). // anchor points
|
||||||
triangles(std::back_inserter(triangles))); // indexed triangles
|
triangles(std::back_inserter(triangles))); // indexed triangles
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ unspecified_type all_default();
|
||||||
* \cgalNamedParamsEnd
|
* \cgalNamedParamsEnd
|
||||||
*/
|
*/
|
||||||
template <typename TriangleMesh, typename NamedParameters>
|
template <typename TriangleMesh, typename NamedParameters>
|
||||||
bool mesh_approximation(const TriangleMesh &tm, const NamedParameters &np)
|
bool approximate_mesh(const TriangleMesh &tm, const NamedParameters &np)
|
||||||
{
|
{
|
||||||
using boost::get_param;
|
using boost::get_param;
|
||||||
using boost::choose_param;
|
using boost::choose_param;
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
|
|
||||||
#include <CGAL/mesh_approximation.h>
|
#include <CGAL/approximate_mesh.h>
|
||||||
|
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel Epic;
|
||||||
typedef CGAL::Simple_cartesian<double> Sckernel;
|
typedef CGAL::Simple_cartesian<double> Sckernel;
|
||||||
|
|
@ -29,7 +29,7 @@ int test() {
|
||||||
std::vector<typename K::Point_3> points;
|
std::vector<typename K::Point_3> points;
|
||||||
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles;
|
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles;
|
||||||
|
|
||||||
CGAL::mesh_approximation(tm,
|
CGAL::approximate_mesh(tm,
|
||||||
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(6).
|
CGAL::Surface_mesh_approximation::parameters::max_nb_proxies(6).
|
||||||
nb_of_iterations(30).
|
nb_of_iterations(30).
|
||||||
nb_of_relaxations(5).
|
nb_of_relaxations(5).
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
|
||||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||||
#include <CGAL/mesh_approximation.h>
|
#include <CGAL/approximate_mesh.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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file tests the free function CGAL::mesh_approximation.
|
* This file tests the free function CGAL::approximate_mesh.
|
||||||
*/
|
*/
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
@ -29,7 +29,7 @@ int main()
|
||||||
std::vector<Kernel::Point_3> points;
|
std::vector<Kernel::Point_3> points;
|
||||||
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles;
|
std::vector<CGAL::cpp11::array<std::size_t, 3> > triangles;
|
||||||
|
|
||||||
CGAL::mesh_approximation(mesh,
|
CGAL::approximate_mesh(mesh,
|
||||||
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Incremental).
|
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Incremental).
|
||||||
max_nb_proxies(6).
|
max_nb_proxies(6).
|
||||||
nb_of_iterations(30).
|
nb_of_iterations(30).
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Polyhedron_3.h>
|
#include <CGAL/Polyhedron_3.h>
|
||||||
#include <CGAL/mesh_approximation.h>
|
#include <CGAL/approximate_mesh.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;
|
||||||
|
|
@ -12,7 +12,7 @@ typedef boost::unordered_map<face_descriptor, std::size_t> Facet_index_map;
|
||||||
typedef boost::associative_property_map<Facet_index_map> Facet_proxy_pmap;
|
typedef boost::associative_property_map<Facet_index_map> Facet_proxy_pmap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This file tests the free function CGAL::mesh_approximation.
|
* This file tests the free function CGAL::approximate_mesh.
|
||||||
*/
|
*/
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
@ -31,7 +31,7 @@ int main()
|
||||||
std::vector<Kernel::Vector_3> proxies;
|
std::vector<Kernel::Vector_3> proxies;
|
||||||
|
|
||||||
// free function interface with named parameters
|
// free function interface with named parameters
|
||||||
CGAL::mesh_approximation(input,
|
CGAL::approximate_mesh(input,
|
||||||
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
|
CGAL::Surface_mesh_approximation::parameters::seeding_method(CGAL::Hierarchical). // hierarchical seeding
|
||||||
max_nb_proxies(200). // both maximum number of proxies stop criterion,
|
max_nb_proxies(200). // both maximum number of proxies stop criterion,
|
||||||
min_error_drop(0.05). // and minimum error drop stop criterion are specified
|
min_error_drop(0.05). // and minimum error drop stop criterion are specified
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue