New API support and docs for make_mesh_3.h

This commit is contained in:
GYuvanShankar 2022-06-21 14:11:49 +05:30
parent 93514bd826
commit 109d74466d
33 changed files with 428 additions and 279 deletions

View File

@ -51,7 +51,7 @@ int main()
Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008,
cell_radius_edge_ratio=3);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Create the generator, input is the C3t3 c3t3
Random_points_in_tetrahedral_mesh_3<C3t3> g(c3t3);

View File

@ -50,7 +50,7 @@ int main()
Mesh_criteria criteria(facet_angle=25, facet_size=0.15, facet_distance=0.008,
cell_radius_edge_ratio=3);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Create the generator, input is the C3t3 c3t3
Random_points_in_tetrahedral_mesh_boundary_3<C3t3> g(c3t3);

View File

@ -531,22 +531,22 @@ bool make_mesh_polyhedron(const std::string &input_filename,
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>( domain
, criteria
# ifdef CGAL_MESH_3_BENCHMARK_LLOYD
, lloyd(time_limit=timelimit)
, lloyd_param_new = lloyd(time_limit=timelimit)
# else
, no_lloyd()
, lloyd_param_new = no_lloyd()
# endif
, no_odt()
, odt_param_new = no_odt()
# ifdef CGAL_MESH_3_BENCHMARK_PERTURB
, perturb(time_limit = timelimit,
, perturb_param_new = perturb(time_limit = timelimit,
sliver_bound = sliverbound)
# else
, no_perturb()
, perturb_param_new = no_perturb()
#endif
#ifdef CGAL_MESH_3_BENCHMARK_EXUDE
, exude(time_limit = timelimit,
, exude_param_new = exude(time_limit = timelimit,
sliver_bound = sliverbound)
#else
, no_exude()
, exude_param_new = no_exude()
#endif
);
@ -637,22 +637,22 @@ bool make_mesh_3D_images(const std::string &input_filename,
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>( domain
, criteria
# ifdef CGAL_MESH_3_BENCHMARK_LLOYD
, lloyd(time_limit=timelimit)
, lloyd_param_new = lloyd(time_limit=timelimit)
# else
, no_lloyd()
, lloyd_param_new = no_lloyd()
# endif
, no_odt()
, odt_param_new = no_odt()
# ifdef CGAL_MESH_3_BENCHMARK_PERTURB
, perturb(time_limit = timelimit,
, perturb_param_new = perturb(time_limit = timelimit,
sliver_bound = sliverbound)
# else
, no_perturb()
, perturb_param_new = no_perturb()
#endif
#ifdef CGAL_MESH_3_BENCHMARK_EXUDE
, exude(time_limit = timelimit,
, exude_param_new = exude(time_limit = timelimit,
sliver_bound = sliverbound)
#else
, no_exude()
, exude_param_new = no_exude()
#endif
);
@ -774,22 +774,22 @@ bool make_mesh_implicit(double facet_approx,
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>( domain
, criteria
# ifdef CGAL_MESH_3_BENCHMARK_LLOYD
, lloyd(time_limit=timelimit)
, lloyd_param_new = lloyd(time_limit=timelimit)
# else
, no_lloyd()
, lloyd_param_new = no_lloyd()
# endif
, no_odt()
, odt_param_new = no_odt()
# ifdef CGAL_MESH_3_BENCHMARK_PERTURB
, perturb(time_limit = timelimit,
, perturb_param_new = perturb(time_limit = timelimit,
sliver_bound = sliverbound)
# else
, no_perturb()
, perturb_param_new = no_perturb()
#endif
#ifdef CGAL_MESH_3_BENCHMARK_EXUDE
, exude(time_limit = timelimit,
, exude_param_new = exude(time_limit = timelimit,
sliver_bound = sliverbound)
#else
, no_exude()
, exude_param_new = no_exude()
#endif
);

View File

@ -1,167 +0,0 @@
namespace CGAL {
/*!
\ingroup PkgMesh3Functions
The function `make_mesh_3()` is a 3D
mesh generator. It produces simplicial meshes which discretize
3D domains.
The mesh generation algorithm is a Delaunay refinement process
followed by an optimization phase.
The criteria driving the Delaunay refinement
process may be tuned to achieve the user needs with respect to
the size of mesh elements, the accuracy of boundaries approximation,
etc.
The optimization phase is a sequence of optimization processes,
amongst the following available optimizers: an ODT-smoothing,
a Lloyd-smoothing, a sliver perturber, and a sliver exuder.
Each optimization process
can be activated or not,
according to the user requirements
and available time.
By default, only the perturber and the exuder are activated.
Note that the benefits of the exuder will be lost if the mesh
is further refined afterward, and that ODT-smoothing, Lloyd-smoothing,
and sliver perturber should never be called after the sliver exuder.
In the case of further refinement, only the sliver exuder can be used.
The function outputs the mesh to an object which provides iterators to
traverse the resulting mesh data structure or can be written to a file
(see \ref Mesh_3_section_examples ).
\tparam C3T3 is required to be a model of
the concept `MeshComplex_3InTriangulation_3`. This is the return type.
The type `C3T3` is in particular required to provide a nested type
`C3T3::Triangulation` for the 3D triangulation
embedding the mesh. The vertex and cell base classes of the
triangulation `C3T3::Triangulation` are required to be models of the
concepts `MeshVertexBase_3` and `MeshCellBase_3`
respectively.
\tparam MD is required to be a model of
the concept `MeshDomain_3`, or of the refined concept
`MeshDomainWithFeatures_3`
if the domain has corners and curves that need to be accurately represented in the mesh.
The argument `domain`
is the sole link through which the domain
to be discretized is known by the mesh generation algorithm.
\tparam MC has to be a model of the concept
`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features.
The argument `criteria` of type `MC` specifies the
size and shape requirements for mesh tetrahedra
and surface facets. These criteria
form the rules which drive the refinement process. All mesh elements
satisfy those criteria at the end of the refinement process.
In addition, if the domain has features, the argument
`criteria` provides a sizing field to guide the discretization
of 1-dimensional exposed features.
\cgalHeading{Named Parameters}
- <b>`features`</b> allows
the user to specify whether 0 and 1-dimensional features have to be
taken into account or not
when the domain is a model of `MeshDomainWithFeatures_3`.
The type `Features` of this parameter is an internal undescribed type.
The library provides functions to construct appropriate values of that type.
<UL>
<LI>\link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain,
i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a
`MeshDomainWithFeatures_3`. This is the default behavior
if parameter `features` is not specified.
<LI>`parameters::no_features()` prevents the representation
of 0 and 1-dimensional features in the mesh.
</UL>
- <b>`manifold`</b> allows the user to drive the meshing algorithm,
and ensure that the output mesh surface follows the given manifold criterion.
It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()`
and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold
surface if the input surface is not manifold.
The four additional parameters are optimization parameters.
They control which optimization processes are performed
and allow the user to tune the parameters of the optimization processes.
Individual optimization parameters are not described here as they are
internal types (see instead the documentation page of each optimizer).
For each optimization algorithm, there exist two global functions
that allow to enable or disable the optimizer:
- <b>`lloyd`</b>: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to
trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the
parameters of this optimizer. If one parameter is not set, the default value of
`lloyd_optimize_mesh_3()` is used for this parameter.
- <b>`ODT`</b>: `parameters::odt()` and `parameters::no_odt()` are designed to
trigger or not a call to `odt_optimize_mesh_3` function and
to set the parameters of this optimizer.
If one parameter is not set, the default value of
`odt_optimize_mesh_3()` is used for this parameter.
- <b>`perturb`</b>: `parameters::perturb()` and `parameters::no_perturb()` are designed to
trigger or not a call to `perturb_mesh_3` function and
to set the parameters of this optimizer. If one parameter is not set, the default value of
`CGAL::perturb_mesh_3` is used for this parameter, except for the time bound which is set to be
equal to the refinement CPU time.
- <b>`exude`</b>: `parameters::exude()` and `parameters::no_exude()` are designed to
trigger or not a call to `exude_mesh_3()` function and to override to set the
parameters of this optimizer. If one parameter is not set, the default value of
`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be
equal to the refinement CPU time.
The optimization parameters can be passed in an arbitrary order. If one parameter
is not passed, its default value is used. The default values are
`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`.
Note that whatever may be the optimization processes activated,
they are always launched in the order that is a suborder
of the following (see user manual for further
details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*.
Beware that optimization of the mesh is obtained
by perturbing mesh vertices and modifying the mesh connectivity
and that this has an impact
on the strict compliance to the refinement criteria.
Though a strict compliance to mesh criteria
is guaranteed at the end of the Delaunay refinement, this may no longer be true after
some optimization processes. Also beware that the default behavior does involve some
optimization processes.
\sa `refine_mesh_3()`
\sa `parameters::features()`
\sa `parameters::no_features()`
\sa `parameters::manifold()`
\sa `parameters::manifold_with_boundary()`
\sa `parameters::non_manifold()`
\sa `exude_mesh_3()`
\sa `perturb_mesh_3()`
\sa `lloyd_optimize_mesh_3()`
\sa `odt_optimize_mesh_3()`
\sa `parameters::exude()`
\sa `parameters::no_exude()`
\sa `parameters::perturb()`
\sa `parameters::no_perturb()`
\sa `parameters::lloyd()`
\sa `parameters::no_lloyd()`
\sa `parameters::odt()`
\sa `parameters::no_odt()`
*/
template <class C3T3, class MD, class MC>
C3T3 make_mesh_3(const MD& domain,
const MC& criteria,
parameters::internal::Features_options features = parameters::features(domain),
parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(),
parameters::internal::Odt_options odt = parameters::no_odt(),
parameters::internal::Perturb_options perturb = parameters::perturb(),
parameters::internal::Exude_options exude = parameters::exude(),
parameters::internal::Manifold_options manifold = parameters::non_manifold());
} /* namespace CGAL */

View File

@ -11,7 +11,8 @@ INPUT += \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/odt_optimize_mesh_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/lloyd_optimize_mesh_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/perturb_mesh_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/refine_mesh_3.h \
${CGAL_PACKAGE_INCLUDE_DIR}/CGAL/make_mesh_3.h
PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - 3D Mesh Generation"
HTML_EXTRA_FILES = ${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_3.jpg \
${CGAL_PACKAGE_DOC_DIR}/fig/implicit_domain_4.jpg \

View File

@ -81,13 +81,13 @@ int main()
cell_radius_edge_ratio = 2, cell_size = 0.4);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb());
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10);
// Exudation
CGAL::exude_mesh_3(c3t3,CGAL::parameters::time_limit_new=12);
CGAL::exude_mesh_3(c3t3,time_limit_new=12);
// Output
std::ofstream medit_file("out_cubes_intersection.mesh");

View File

@ -168,7 +168,7 @@ int main()
cell_radius_edge_ratio = 2, cell_size = 0.4);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb());
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10);

View File

@ -240,7 +240,7 @@ int main()
// Mesh generation (without optimization)
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(), no_exude());
perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Output
dump_c3t3(c3t3, "out");

View File

@ -57,7 +57,7 @@ int main()
Mesh_criteria criteria(facet_criteria, cell_criteria);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb());
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
CGAL::perturb_mesh_3(c3t3, domain, time_limit_new = 10);

View File

@ -59,7 +59,7 @@ int main()
Mesh_criteria criteria(facet_criteria, cell_criteria);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb());
// Perturbation (maximum cpu time: 10s, targeted dihedral angle: default)
CGAL::perturb_mesh_3(c3t3, domain, time_limit = 10);

View File

@ -51,7 +51,7 @@ int main()
Mesh_criteria criteria(facet_criteria, cell_criteria);
// Mesh generation (without optimization)
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Output
std::ofstream medit_file("out_wo.mesh");

View File

@ -65,7 +65,7 @@ int main()
cell_radius_edge_ratio=2, cell_size=size);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb());
// Output
std::ofstream medit_file("out.mesh");

View File

@ -48,12 +48,12 @@ int main(int argc, char* argv[])
// Mesh generation and optimization in one call (sliver_bound is the
// targeted dihedral angle in degrees)
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_exude(),
perturb(sliver_bound=10, time_limit=15));
exude_param_new = no_exude(),
perturb_param_new = perturb(sliver_bound=10, time_limit=15));
// Mesh generation and optimization in several call
C3t3 c3t3_bis = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(), no_exude());
perturb_param_new = no_perturb(), exude_param_new = no_exude());
CGAL::perturb_mesh_3(c3t3_bis, domain, time_limit_new=15);

View File

@ -46,13 +46,13 @@ int main(int argc, char*argv[])
// Mesh generation and optimization in one call
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
lloyd(time_limit=30),
no_perturb(),
exude(time_limit=10, sliver_bound=10));
lloyd_param_new = lloyd(time_limit=30),
perturb_param_new = no_perturb(),
exude_param_new = exude(time_limit=10, sliver_bound=10));
// Mesh generation and optimization in several call
C3t3 c3t3_bis = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(), no_exude());
perturb_param_new = no_perturb(), exude_param_new = no_exude());
CGAL::lloyd_optimize_mesh_3(c3t3_bis, domain, time_limit_new=30);
CGAL::exude_mesh_3(c3t3_bis, sliver_bound_new=10, time_limit_new=10);

View File

@ -57,7 +57,7 @@ int main(int argc, char*argv[])
cell_radius_edge_ratio=3);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Output
std::ofstream medit_file("out_1.mesh");
@ -68,7 +68,7 @@ int main(int argc, char*argv[])
Mesh_criteria new_criteria(cell_radius_edge_ratio=3, cell_size=0.03);
// Mesh refinement (and make the output manifold)
CGAL::refine_mesh_3(c3t3, domain, new_criteria, CGAL::parameters::manifold_options_param_new = manifold());
CGAL::refine_mesh_3(c3t3, domain, new_criteria, manifold_options_param_new = manifold());
// Output
medit_file.open("out_2.mesh");

View File

@ -57,7 +57,7 @@ int main(int argc, char*argv[])
cell_radius_edge_ratio=3);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Output
std::ofstream medit_file("out_1.mesh");

View File

@ -59,7 +59,7 @@ int main(int argc, char*argv[])
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(), no_exude());
perturb_param_new = no_perturb(), exude_param_new = no_exude());
std::cerr << t.time() << " sec." << std::endl;
// Output

View File

@ -85,7 +85,7 @@ int main()
// Mesh generation without feature preservation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
CGAL::parameters::no_features());
features_param_new = CGAL::parameters::no_features());
std::ofstream medit_file("out-no-protection.mesh");
c3t3.output_to_medit(medit_file);

View File

@ -55,7 +55,7 @@ int main()
facet_distance = 0.001);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Output the facets of the c3t3 to an OFF file. The facets will not be
// oriented.

View File

@ -54,7 +54,7 @@ int main()
facet_distance = 0.001);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
// Output the facets of the c3t3 to an OFF file. The facets will not be
// oriented.

View File

@ -369,57 +369,202 @@ struct C3t3_initializer < C3T3, MD, MC, true, CGAL::Tag_false >
// make_mesh_3 stuff
// -----------------------------------
// Manual redirections
// boost::parameter can't handle make_mesh_3 return_type alone...
template <typename C3T3, typename MD, typename MC, typename ... T>
C3T3 make_mesh_3(const MD& md, const MC& mc, const T& ...t)
/*!
\ingroup PkgMesh3Functions
The function `make_mesh_3()` is a 3D
mesh generator. It produces simplicial meshes which discretize
3D domains.
The mesh generation algorithm is a Delaunay refinement process
followed by an optimization phase.
The criteria driving the Delaunay refinement
process may be tuned to achieve the user needs with respect to
the size of mesh elements, the accuracy of boundaries approximation,
etc.
The optimization phase is a sequence of optimization processes,
amongst the following available optimizers: an ODT-smoothing,
a Lloyd-smoothing, a sliver perturber, and a sliver exuder.
Each optimization process
can be activated or not,
according to the user requirements
and available time.
By default, only the perturber and the exuder are activated.
Note that the benefits of the exuder will be lost if the mesh
is further refined afterward, and that ODT-smoothing, Lloyd-smoothing,
and sliver perturber should never be called after the sliver exuder.
In the case of further refinement, only the sliver exuder can be used.
The function outputs the mesh to an object which provides iterators to
traverse the resulting mesh data structure or can be written to a file
(see \ref Mesh_3_section_examples ).
\tparam C3T3 is required to be a model of
the concept `MeshComplex_3InTriangulation_3`. This is the return type.
The type `C3T3` is in particular required to provide a nested type
`C3T3::Triangulation` for the 3D triangulation
embedding the mesh. The vertex and cell base classes of the
triangulation `C3T3::Triangulation` are required to be models of the
concepts `MeshVertexBase_3` and `MeshCellBase_3`
respectively.
\tparam MD is required to be a model of
the concept `MeshDomain_3`, or of the refined concept
`MeshDomainWithFeatures_3`
if the domain has corners and curves that need to be accurately represented in the mesh.
The argument `domain`
is the sole link through which the domain
to be discretized is known by the mesh generation algorithm.
\tparam MC has to be a model of the concept
`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features.
The argument `criteria` of type `MC` specifies the
size and shape requirements for mesh tetrahedra
and surface facets. These criteria
form the rules which drive the refinement process. All mesh elements
satisfy those criteria at the end of the refinement process.
In addition, if the domain has features, the argument
`criteria` provides a sizing field to guide the discretization
of 1-dimensional exposed features.
\tparam NamedParameters a sequence of \ref bgl_namedparameters "Named Parameters"
\cgalNamedParamsBegin
\cgalParamNBegin{features_param_new}
\cgalParamDescription{allows the user to specify whether 0 and 1-dimensional features have to be
taken into account or not
when the domain is a model of `MeshDomainWithFeatures_3`.
The type `Features` of this parameter is an internal undescribed type.
The library provides functions to construct appropriate values of that type.
<UL>
<LI>\link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain,
i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a
`MeshDomainWithFeatures_3`. This is the default behavior
if parameter `features` is not specified.
<LI>`parameters::no_features()` prevents the representation
of 0 and 1-dimensional features in the mesh.
</UL>}
\cgalParamType{`parameters::features()' OR `parameters::features(domain)`}
\cgalParamDefault{`parameters::features(domain)`}
\cgalParamNBegin{manifold_options_param_new}
\cgalParamDescription{allows the user to drive the meshing algorithm,
and ensure that the output mesh surface follows the given manifold criterion.
It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()`
and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold
surface if the input surface is not manifold.}
\cgalParamType{`parameters::manifold()` OR `parameters::manifold_with_boundary()` OR `parameters::non_manifold()`}
\cgalParamDefault{`parameters::non_manifold()`}
\cgalParamNBegin{lloyd_param_new}
\cgalParamDescription{`parameters::lloyd()` and `parameters::no_lloyd()` are designed to
trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the
parameters of this optimizer. If one parameter is not set, the default value of
`lloyd_optimize_mesh_3()` is used for this parameter.}
\cgalParamType{`parameters::lloyd()` OR `parameters::no_lloyd()`}
\cgalParamDefault{`parameters::no_lloyd()`}
\cgalParamNBegin{odt_param_new}
\cgalParamDescription{`parameters::odt()` and `parameters::no_odt()` are designed to
trigger or not a call to `odt_optimize_mesh_3()` function and
to set the parameters of this optimizer.
If one parameter is not set, the default value of
`odt_optimize_mesh_3()` is used for this parameter.}
\cgalParamType{`parameters::odt()` OR `parameters::no_odt()`}
\cgalParamDefault{`parameters::no_odt()`}
\cgalParamNBegin{perturb_param_new}
\cgalParamDescription{`parameters::perturb()` and `parameters::no_perturb()` are designed to
trigger or not a call to `perturb_mesh_3()` function and
to set the parameters of this optimizer. If one parameter is not set, the default value of
`perturb_mesh_3()` is used for this parameter, except for the time bound which is set to be
equal to the refinement CPU time.}
\cgalParamType{`parameters::perturb()` and `parameters::no_perturb()`}
\cgalParamDefault{`parameters::no_perturb`}
\cgalParamNBegin{exude_param_new}
\cgalParamDescription{parameters::exude()` and `parameters::no_exude()` are designed to
trigger or not a call to `exude_mesh_3()` function and to override to set the
parameters of this optimizer. If one parameter is not set, the default value of
`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be
equal to the refinement CPU time.}
\cgalParamType{`parameters::exude()` and `parameters::no_exude()`}
\cgalParamDefault{`parameters::no_exude`}
\cgalNamedParamsEnd
The optimization parameters can be passed in an arbitrary order. If one parameter
is not passed, its default value is used. The default values are
`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`.
Note that whatever may be the optimization processes activated,
they are always launched in the order that is a suborder
of the following (see user manual for further
details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*.
Beware that optimization of the mesh is obtained
by perturbing mesh vertices and modifying the mesh connectivity
and that this has an impact
on the strict compliance to the refinement criteria.
Though a strict compliance to mesh criteria
is guaranteed at the end of the Delaunay refinement, this may no longer be true after
some optimization processes. Also beware that the default behavior does involve some
optimization processes.
\sa `refine_mesh_3()`
\sa `parameters::features()`
\sa `parameters::no_features()`
\sa `parameters::manifold()`
\sa `parameters::manifold_with_boundary()`
\sa `parameters::non_manifold()`
\sa `exude_mesh_3()`
\sa `perturb_mesh_3()`
\sa `lloyd_optimize_mesh_3()`
\sa `odt_optimize_mesh_3()`
\sa `parameters::exude()`
\sa `parameters::no_exude()`
\sa `parameters::perturb()`
\sa `parameters::no_perturb()`
\sa `parameters::lloyd()`
\sa `parameters::no_lloyd()`
\sa `parameters::odt()`
\sa `parameters::no_odt()`
*/
template<typename C3T3, typename MeshDomain, typename MeshCriteria, typename CGAL_NP_TEMPLATE_PARAMETERS>
C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const CGAL_NP_CLASS& np = parameters::default_values())
{
C3T3 c3t3;
make_mesh_3_bp(c3t3,md,mc,t...);
return c3t3;
using parameters::choose_parameter;
using parameters::get_parameter;
C3T3 c3t3;
parameters::internal::Exude_options exude_param = choose_parameter(get_parameter(np, internal_np::exude_options_param), parameters::exude());
parameters::internal::Perturb_options perturb_param = choose_parameter(get_parameter(np, internal_np::perturb_options_param), parameters::perturb());
parameters::internal::Odt_options odt_param = choose_parameter(get_parameter(np, internal_np::odt_options_param), parameters::no_odt());
parameters::internal::Lloyd_options lloyd_param = choose_parameter(get_parameter(np, internal_np::lloyd_options_param), parameters::no_lloyd());
parameters::internal::Features_options features_param = choose_parameter(get_parameter(np, internal_np::features_options_param), parameters::features(domain));
parameters::internal::Mesh_3_options mesh_options_param = choose_parameter(get_parameter(np, internal_np::mesh_param), parameters::internal::Mesh_3_options());
parameters::internal::Manifold_options manifold_options_param = choose_parameter(get_parameter(np, internal_np::manifold_param), parameters::internal::Manifold_options());
make_mesh_3_impl(c3t3, domain, criteria,
exude_param, perturb_param, odt_param, lloyd_param,
features_param.features(), mesh_options_param,
manifold_options_param);
return c3t3;
}
#if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable:4003) // not enough actual parameters for macro
#endif
// see <CGAL/config.h>
CGAL_PRAGMA_DIAG_PUSH
// see <CGAL/boost/parameter.h>
CGAL_IGNORE_BOOST_PARAMETER_NAME_WARNINGS
BOOST_PARAMETER_FUNCTION(
(void),
make_mesh_3_bp,
parameters::tag,
(required (in_out(c3t3),*) (domain,*) (criteria,*) ) // nondeduced
(deduced
(optional
(features_param, (parameters::internal::Features_options), parameters::features(domain))
(exude_param, (parameters::internal::Exude_options), parameters::exude())
(perturb_param, (parameters::internal::Perturb_options), parameters::perturb())
(odt_param, (parameters::internal::Odt_options), parameters::no_odt())
(lloyd_param, (parameters::internal::Lloyd_options), parameters::no_lloyd())
(mesh_options_param, (parameters::internal::Mesh_3_options),
parameters::internal::Mesh_3_options())
(manifold_options_param, (parameters::internal::Manifold_options),
parameters::internal::Manifold_options())
)
)
)
#ifndef DOXYGEN_RUNNING
#ifndef CGAL_NO_DEPRECATED_CODE
template<typename C3T3, typename MeshDomain, typename MeshCriteria, typename ... NP_PACK>
C3T3 make_mesh_3(MeshDomain& domain, MeshCriteria& criteria, const NP_PACK&...nps)
{
make_mesh_3_impl(c3t3, domain, criteria,
exude_param, perturb_param, odt_param, lloyd_param,
features_param.features(), mesh_options_param,
manifold_options_param);
return make_mesh_3<C3T3>(domain, criteria, internal_np::combine_named_parameters(nps...));
}
CGAL_PRAGMA_DIAG_POP
#endif //CGAL_NO_DEPRECATED_CODE
#if defined(BOOST_MSVC)
# pragma warning(pop)
#endif
/**
* @brief This function meshes the domain defined by mesh_traits
@ -470,9 +615,177 @@ void make_mesh_3_impl(C3T3& c3t3,
parameters::reset_param_new=parameters::no_reset_c3t3(), parameters::mesh_options_param_new= mesh_options,
parameters::manifold_options_param_new= manifold_options);
}
#else
namespace CGAL {
/*!
\ingroup PkgMesh3Functions
\deprecated This function is deprecated since \cgal 5.5, the overload using `NamedParameters` must be used instead.
The function `make_mesh_3()` is a 3D
mesh generator. It produces simplicial meshes which discretize
3D domains.
The mesh generation algorithm is a Delaunay refinement process
followed by an optimization phase.
The criteria driving the Delaunay refinement
process may be tuned to achieve the user needs with respect to
the size of mesh elements, the accuracy of boundaries approximation,
etc.
The optimization phase is a sequence of optimization processes,
amongst the following available optimizers: an ODT-smoothing,
a Lloyd-smoothing, a sliver perturber, and a sliver exuder.
Each optimization process
can be activated or not,
according to the user requirements
and available time.
By default, only the perturber and the exuder are activated.
Note that the benefits of the exuder will be lost if the mesh
is further refined afterward, and that ODT-smoothing, Lloyd-smoothing,
and sliver perturber should never be called after the sliver exuder.
In the case of further refinement, only the sliver exuder can be used.
The function outputs the mesh to an object which provides iterators to
traverse the resulting mesh data structure or can be written to a file
(see \ref Mesh_3_section_examples ).
\tparam C3T3 is required to be a model of
the concept `MeshComplex_3InTriangulation_3`. This is the return type.
The type `C3T3` is in particular required to provide a nested type
`C3T3::Triangulation` for the 3D triangulation
embedding the mesh. The vertex and cell base classes of the
triangulation `C3T3::Triangulation` are required to be models of the
concepts `MeshVertexBase_3` and `MeshCellBase_3`
respectively.
\tparam MD is required to be a model of
the concept `MeshDomain_3`, or of the refined concept
`MeshDomainWithFeatures_3`
if the domain has corners and curves that need to be accurately represented in the mesh.
The argument `domain`
is the sole link through which the domain
to be discretized is known by the mesh generation algorithm.
\tparam MC has to be a model of the concept
`MeshCriteria_3`, or a model of the refined concept `MeshCriteriaWithFeatures_3` if the domain has exposed features.
The argument `criteria` of type `MC` specifies the
size and shape requirements for mesh tetrahedra
and surface facets. These criteria
form the rules which drive the refinement process. All mesh elements
satisfy those criteria at the end of the refinement process.
In addition, if the domain has features, the argument
`criteria` provides a sizing field to guide the discretization
of 1-dimensional exposed features.
\cgalHeading{Named Parameters}
- <b>`features`</b> allows
the user to specify whether 0 and 1-dimensional features have to be
taken into account or not
when the domain is a model of `MeshDomainWithFeatures_3`.
The type `Features` of this parameter is an internal undescribed type.
The library provides functions to construct appropriate values of that type.
<UL>
<LI>\link parameters::features() `parameters::features(domain)` \endlink sets `features` according to the domain,
i.e.\ 0 and 1-dimensional features are taken into account if `domain` is a
`MeshDomainWithFeatures_3`. This is the default behavior
if parameter `features` is not specified.
<LI>`parameters::no_features()` prevents the representation
of 0 and 1-dimensional features in the mesh.
</UL>
- <b>`manifold`</b> allows the user to drive the meshing algorithm,
and ensure that the output mesh surface follows the given manifold criterion.
It can be activated with `parameters::manifold()`, `parameters::manifold_with_boundary()`
and `parameters::non_manifold()`. Note that the meshing algorithm cannot generate a manifold
surface if the input surface is not manifold.
The four additional parameters are optimization parameters.
They control which optimization processes are performed
and allow the user to tune the parameters of the optimization processes.
Individual optimization parameters are not described here as they are
internal types (see instead the documentation page of each optimizer).
For each optimization algorithm, there exist two global functions
that allow to enable or disable the optimizer:
- <b>`lloyd`</b>: `parameters::lloyd()` and `parameters::no_lloyd()` are designed to
trigger or not a call to `lloyd_optimize_mesh_3()` function and to set the
parameters of this optimizer. If one parameter is not set, the default value of
`lloyd_optimize_mesh_3()` is used for this parameter.
- <b>`ODT`</b>: `parameters::odt()` and `parameters::no_odt()` are designed to
trigger or not a call to `odt_optimize_mesh_3` function and
to set the parameters of this optimizer.
If one parameter is not set, the default value of
`odt_optimize_mesh_3()` is used for this parameter.
- <b>`perturb`</b>: `parameters::perturb()` and `parameters::no_perturb()` are designed to
trigger or not a call to `perturb_mesh_3` function and
to set the parameters of this optimizer. If one parameter is not set, the default value of
`CGAL::perturb_mesh_3` is used for this parameter, except for the time bound which is set to be
equal to the refinement CPU time.
- <b>`exude`</b>: `parameters::exude()` and `parameters::no_exude()` are designed to
trigger or not a call to `exude_mesh_3()` function and to override to set the
parameters of this optimizer. If one parameter is not set, the default value of
`exude_mesh_3()` is used for this parameter, except for the time bound which is set to be
equal to the refinement CPU time.
The optimization parameters can be passed in an arbitrary order. If one parameter
is not passed, its default value is used. The default values are
`no_lloyd()`, `no_odt()`, `perturb()` and `exude()`.
Note that whatever may be the optimization processes activated,
they are always launched in the order that is a suborder
of the following (see user manual for further
details): *ODT-smoother*, *Lloyd-smoother*, *perturber*, and *exuder*.
Beware that optimization of the mesh is obtained
by perturbing mesh vertices and modifying the mesh connectivity
and that this has an impact
on the strict compliance to the refinement criteria.
Though a strict compliance to mesh criteria
is guaranteed at the end of the Delaunay refinement, this may no longer be true after
some optimization processes. Also beware that the default behavior does involve some
optimization processes.
\sa `refine_mesh_3()`
\sa `parameters::features()`
\sa `parameters::no_features()`
\sa `parameters::manifold()`
\sa `parameters::manifold_with_boundary()`
\sa `parameters::non_manifold()`
\sa `exude_mesh_3()`
\sa `perturb_mesh_3()`
\sa `lloyd_optimize_mesh_3()`
\sa `odt_optimize_mesh_3()`
\sa `parameters::exude()`
\sa `parameters::no_exude()`
\sa `parameters::perturb()`
\sa `parameters::no_perturb()`
\sa `parameters::lloyd()`
\sa `parameters::no_lloyd()`
\sa `parameters::odt()`
\sa `parameters::no_odt()`
*/
template <class C3T3, class MD, class MC>
C3T3 make_mesh_3(const MD& domain,
const MC& criteria,
parameters::internal::Features_options features = parameters::features(domain),
parameters::internal::Lloyd_options lloyd = parameters::no_lloyd(),
parameters::internal::Odt_options odt = parameters::no_odt(),
parameters::internal::Perturb_options perturb = parameters::perturb(),
parameters::internal::Exude_options exude = parameters::exude(),
parameters::internal::Manifold_options manifold = parameters::non_manifold());
} /* namespace CGAL */
#endif //DOXYGEN_RUNNING
} // end namespace CGAL
#include <CGAL/enable_warnings.h>
#endif // CGAL_MAKE_MESH_3_H

View File

@ -76,7 +76,7 @@ int main()
Mesh_criteria criteria(facet_criteria, cell_criteria);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb());
// Output
std::stringstream off_file;

View File

@ -66,7 +66,7 @@ int main(int argc, char*argv[])
cell_radius_edge_ratio = 3);
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_perturb(), no_exude());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, perturb_param_new = no_perturb(), exude_param_new = no_exude());
Gt::Construct_weighted_circumcenter_3 w_circumcenter =
c3t3.triangulation().geom_traits().construct_weighted_circumcenter_3_object();

View File

@ -82,10 +82,10 @@ public:
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(),
no_exude(),
mesh_3_options(number_of_initial_points_new = 30),
non_manifold()
perturb_param_new = no_perturb(),
exude_param_new = no_exude(),
mesh_options_param_new = mesh_3_options(number_of_initial_points_new = 30),
manifold_options_param_new = non_manifold()
);
// Verify

View File

@ -74,10 +74,10 @@ public:
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(),
no_exude(),
mesh_3_options(number_of_initial_points_new = 30),
non_manifold()
perturb_param_new = no_perturb(),
exude_param_new = no_exude(),
mesh_options_param_new = mesh_3_options(number_of_initial_points_new = 30),
manifold_options_param_new = non_manifold()
);
// Verify

View File

@ -58,8 +58,8 @@ public:
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
CGAL::parameters::no_exude(),
CGAL::parameters::no_perturb());
CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(),
CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb());
c3t3.remove_isolated_vertices();

View File

@ -42,8 +42,8 @@ public:
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
CGAL::parameters::no_exude(),
CGAL::parameters::no_perturb());
CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(),
CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb());
// Verify
this->verify_c3t3_volume(c3t3, 1772330*0.95, 1772330*1.05);

View File

@ -73,8 +73,8 @@ void test()
{
std::cout << "------- Iteration " << (i+1) << " -------" << std::endl;
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
no_perturb(),
no_exude());
perturb_param_new = no_perturb(),
exude_param_new = no_exude());
std::ostringstream oss;
c3t3.output_to_medit(oss);
output_c3t3.push_back(oss.str()); //[5*i]

View File

@ -125,9 +125,9 @@ struct Polyhedron_with_features_tester : public Tester<K>
// Mesh generation
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria,
CGAL::parameters::manifold(),
CGAL::parameters::no_exude(),
CGAL::parameters::no_perturb());
CGAL::parameters::manifold_options_param_new = CGAL::parameters::manifold(),
CGAL::parameters::exude_param_new = CGAL::parameters::no_exude(),
CGAL::parameters::perturb_param_new = CGAL::parameters::no_perturb());
CGAL::remove_far_points_in_mesh_3(c3t3);

View File

@ -72,7 +72,7 @@ int main(int, char**)
CGAL::parameters::facet_size = 4,
CGAL::parameters::facet_distance = 0.1);
C3t3 c3t3 = CGAL::make_mesh_3<C3t3> (domain, criteria,
CGAL::parameters::manifold());
CGAL::parameters::manifold_options_param_new = CGAL::parameters::manifold());
return EXIT_SUCCESS;
}

View File

@ -366,6 +366,7 @@ const Boost_parameter_compatibility_wrapper<internal_np::lloyd_options_param_t>
const Boost_parameter_compatibility_wrapper<internal_np::reset_options_param_t> reset_param_new;
const Boost_parameter_compatibility_wrapper<internal_np::mesh_param_t> mesh_options_param_new;
const Boost_parameter_compatibility_wrapper<internal_np::manifold_param_t> manifold_options_param_new;
const Boost_parameter_compatibility_wrapper<internal_np::features_option_param_t> features_param_new;
#endif
// function to extract a parameter

View File

@ -277,3 +277,4 @@ CGAL_add_named_parameter(lloyd_options_param_t, lloyd_options_param, lloyd_optio
CGAL_add_named_parameter(reset_options_param_t, reset_options_param, reset_options_param)
CGAL_add_named_parameter(mesh_param_t, mesh_param, mesh_param)
CGAL_add_named_parameter(manifold_param_t, manifold_param, manifold_param)
CGAL_add_named_parameter(features_option_param_t,features_options_param,features_options_param)

View File

@ -47,7 +47,7 @@ int main()
Mesh_criteria criteria(facet_criteria, cell_criteria);
// Meshing
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, no_exude(), no_perturb());
C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria, exude_param_new = no_exude(), perturb_param_new = no_perturb());
std::cout << "Meshing done." << std::endl;