mirror of https://github.com/CGAL/cgal
apply Laurent's review and rename some parameters
This commit is contained in:
parent
2a8335b60b
commit
56003ec27e
|
|
@ -138,7 +138,7 @@ CGAL_add_named_parameter(optimize_anchor_location_t, optimize_anchor_location, o
|
||||||
CGAL_add_named_parameter(pca_plane_t, pca_plane, pca_plane)
|
CGAL_add_named_parameter(pca_plane_t, pca_plane, pca_plane)
|
||||||
|
|
||||||
// tetrahedral remeshing parameters
|
// tetrahedral remeshing parameters
|
||||||
CGAL_add_named_parameter(protect_boundaries_t, protect_boundaries, protect_boundaries)
|
CGAL_add_named_parameter(remesh_boundaries_t, remesh_boundaries, remesh_boundaries)
|
||||||
CGAL_add_named_parameter(cell_selector_t, cell_selector, cell_selector)
|
CGAL_add_named_parameter(cell_selector_t, cell_selector, cell_selector)
|
||||||
|
|
||||||
// output parameters
|
// output parameters
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ public Q_SLOTS:
|
||||||
time.restart();
|
time.restart();
|
||||||
|
|
||||||
CGAL::tetrahedral_adaptive_remeshing(tr, target_length,
|
CGAL::tetrahedral_adaptive_remeshing(tr, target_length,
|
||||||
CGAL::parameters::protect_boundaries(protect)
|
CGAL::parameters::remesh_boundaries(!protect)
|
||||||
.number_of_iterations(nb_iter));
|
.number_of_iterations(nb_iter));
|
||||||
|
|
||||||
std::cout << "Remeshing done (" << time.elapsed() << " ms)" << std::endl;
|
std::cout << "Remeshing done (" << time.elapsed() << " ms)" << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
/// The concept `RemeshingCellBase_3` defines the requirements for the cell base
|
/// The concept `RemeshingCellBase_3` defines the requirements for the cell base
|
||||||
/// used in the triangulation given as input to the remeshing algorithm
|
/// used in the triangulation given as input to the remeshing algorithm
|
||||||
///
|
///
|
||||||
/// \cgalRefines `TriangulationCellBaseWithInfo_3`, `CopyConstructible`
|
/// \cgalRefines `TriangulationCellBase_3`, `CopyConstructible`
|
||||||
/// \cgalHasModel `CGAL::Tetrahedral_remeshing::Remeshing_cell_base`.
|
/// \cgalHasModel `CGAL::Tetrahedral_remeshing::Remeshing_cell_base`.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,14 @@ in the mesh.\n
|
||||||
\b Default value is `1`
|
\b Default value is `1`
|
||||||
\cgalNPEnd
|
\cgalNPEnd
|
||||||
|
|
||||||
\cgalNPBegin{protect_boundaries}
|
\cgalNPBegin{remeshing_boundaries}
|
||||||
\anchor Remeshing_protect_boundaries
|
\anchor Remeshing_protect_boundaries
|
||||||
a Boolean that states whether the boundaries should be preserved by the remeshing
|
a Boolean that states whether the boundaries should be remeshed or
|
||||||
|
exactly preserved by the remeshing
|
||||||
process. Boundaries are between the exterior and the interior,
|
process. Boundaries are between the exterior and the interior,
|
||||||
between two subdomains, and between the areas selected or not for remeshing
|
between two subdomains, and between the areas selected or not for remeshing
|
||||||
(cf \ref Remeshing_cell_is_selected_map).
|
(cf \ref Remeshing_cell_is_selected_map).
|
||||||
If `true`, they are preserved. Otherwise, they can be modified.\n
|
If `true`, they are remeshed. Otherwise, they cannot be modified by the remeshing process.\n
|
||||||
\b Type : `bool` \n
|
\b Type : `bool` \n
|
||||||
\b Default value is `false`
|
\b Default value is `false`
|
||||||
\cgalNPEnd
|
\cgalNPEnd
|
||||||
|
|
@ -77,7 +78,7 @@ the atomic operations that are performed,
|
||||||
so the property map must be writable.
|
so the property map must be writable.
|
||||||
It must be default constructible.\n
|
It must be default constructible.\n
|
||||||
<b>Default:</b> a default property map where all cells of the domain
|
<b>Default:</b> a default property map where all cells of the domain
|
||||||
(i.e. with a non-zero `Subdomain_index` are selected)
|
(i.e. with a non-zero `Subdomain_index`) are selected.
|
||||||
\cgalNPEnd
|
\cgalNPEnd
|
||||||
|
|
||||||
\cgalNPTableEnd
|
\cgalNPTableEnd
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ namespace CGAL {
|
||||||
\section secTetRemeshing Multi-Material Tetrahedral Remeshing
|
\section secTetRemeshing Multi-Material Tetrahedral Remeshing
|
||||||
|
|
||||||
This package implements an algorithm for quality tetrahedral remeshing,
|
This package implements an algorithm for quality tetrahedral remeshing,
|
||||||
introduced by N.Faraj et al in%\cgalCite{faraj2016mvr}.
|
introduced by N.Faraj et al in \cgalCite{faraj2016mvr}.
|
||||||
This practical iterative remeshing algorithm is designed to remesh
|
This practical iterative remeshing algorithm is designed to remesh
|
||||||
multi-material tetrahedral meshes, by iteratively performing a sequence of simple
|
multi-material tetrahedral meshes, by iteratively performing a sequence of simple
|
||||||
elementary operations such as edge collapses, edge splits, edge flips,
|
elementary operations such as edge collapses, edge splits, edge flips,
|
||||||
and vertex relocations following a Laplacian smoothing.
|
and vertex relocations following a Laplacian smoothing.
|
||||||
The algorithm results in high quality isotropic meshes, with the desired mesh density,
|
The algorithm results in high quality isotropic meshes, with the desired mesh density,
|
||||||
while preserving the input geometric polyline and surfacic features.
|
while preserving the input geometric linear and surfacic features.
|
||||||
|
|
||||||
Specific remeshing rules have been designed to satisfy the following criteria.
|
Specific remeshing rules have been designed to satisfy the following criteria.
|
||||||
First, the algorithm preserves the geometric complex topology, including
|
First, the algorithm preserves the geometric complex topology, including
|
||||||
|
|
@ -33,7 +33,6 @@ The tetrahedral remeshing algorithm improves the quality of dihedral angles,
|
||||||
while targetting the user-defined uniform sizing field and preserving the
|
while targetting the user-defined uniform sizing field and preserving the
|
||||||
topology of the feature complex, as highlighted by Figure \cgalFigureRef{Remesh_liver}.
|
topology of the feature complex, as highlighted by Figure \cgalFigureRef{Remesh_liver}.
|
||||||
|
|
||||||
|
|
||||||
\cgalFigureBegin{Remesh_liver, tetrahedral_remeshing_before_after.png}
|
\cgalFigureBegin{Remesh_liver, tetrahedral_remeshing_before_after.png}
|
||||||
Tetrahedral mesh, modified by our uniform tetrahedral remeshing method.
|
Tetrahedral mesh, modified by our uniform tetrahedral remeshing method.
|
||||||
(Left) Before remeshing, dihedral angles were in the interval [1.3; 177.8].
|
(Left) Before remeshing, dihedral angles were in the interval [1.3; 177.8].
|
||||||
|
|
@ -41,6 +40,8 @@ Tetrahedral mesh, modified by our uniform tetrahedral remeshing method.
|
||||||
dihedral angles were are the interval [9.5; 161.9].
|
dihedral angles were are the interval [9.5; 161.9].
|
||||||
\cgalFigureEnd
|
\cgalFigureEnd
|
||||||
|
|
||||||
|
Experimental evidence show that a higher number of remeshing iterations
|
||||||
|
lead to a mesh with a better fitted sizing criterion, and higher quality dihedral angles.
|
||||||
|
|
||||||
\section secTetRemeshingAPI API
|
\section secTetRemeshingAPI API
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,10 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
T3 t3;
|
T3 t3;
|
||||||
if (!input)
|
if (!input)
|
||||||
return false;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
if( !load_binary_triangulation(input, t3))
|
if( !load_binary_triangulation(input, t3))
|
||||||
return false;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
CGAL::tetrahedral_adaptive_remeshing(t3, target_edge_length);
|
CGAL::tetrahedral_adaptive_remeshing(t3, target_edge_length);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ typedef Remeshing_triangulation::Vertex_handle Vertex_handle;
|
||||||
typedef Remeshing_triangulation::Cell_handle Cell_handle;
|
typedef Remeshing_triangulation::Cell_handle Cell_handle;
|
||||||
typedef Remeshing_triangulation::Edge Edge;
|
typedef Remeshing_triangulation::Edge Edge;
|
||||||
|
|
||||||
template <typename T3>
|
|
||||||
class Constrained_edges_property_map
|
class Constrained_edges_property_map
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -74,7 +73,7 @@ void add_edge(Vertex_handle v1,
|
||||||
Cell_handle c;
|
Cell_handle c;
|
||||||
int i, j;
|
int i, j;
|
||||||
if(tr.is_edge(v1, v2, c, i, j))
|
if(tr.is_edge(v1, v2, c, i, j))
|
||||||
constraints.insert(std::make_pair(c->vertex(i), c->vertex(j)));
|
constraints.insert(std::make_pair(v1, v2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void generate_input(const std::size_t& n,
|
void generate_input(const std::size_t& n,
|
||||||
|
|
@ -156,7 +155,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
CGAL::tetrahedral_adaptive_remeshing(t3, target_edge_length,
|
CGAL::tetrahedral_adaptive_remeshing(t3, target_edge_length,
|
||||||
CGAL::parameters::edge_is_constrained_map(
|
CGAL::parameters::edge_is_constrained_map(
|
||||||
Constrained_edges_property_map<Remeshing_triangulation>(&constraints))
|
Constrained_edges_property_map(&constraints))
|
||||||
.number_of_iterations(nb_iter));
|
.number_of_iterations(nb_iter));
|
||||||
|
|
||||||
save_ascii_triangulation("tet_remeshing_with_features_after.mesh", t3);
|
save_ascii_triangulation("tet_remeshing_with_features_after.mesh", t3);
|
||||||
|
|
|
||||||
|
|
@ -41,15 +41,11 @@ used in the tetrahedral remeshing process.
|
||||||
\tparam Gt is the geometric traits class.
|
\tparam Gt is the geometric traits class.
|
||||||
It has to be a model of the concept `RemeshingTriangulationTraits_3`.
|
It has to be a model of the concept `RemeshingTriangulationTraits_3`.
|
||||||
|
|
||||||
\tparam Info is the information the user would like to add to a cell.
|
|
||||||
It has to be `DefaultConstructible` and `Assignable`.
|
|
||||||
|
|
||||||
\tparam Cb is a cell base class from which `Remeshing_cell_base` derives.
|
\tparam Cb is a cell base class from which `Remeshing_cell_base` derives.
|
||||||
It must be a model of the `TriangulationCellBase_3` concept.
|
It must be a model of the `TriangulationCellBase_3` concept.
|
||||||
It has the default value `Triangulation_cell_base_3<Gt>`.
|
It has the default value `Triangulation_cell_base_3<Gt>`.
|
||||||
|
|
||||||
\cgalModels `RemeshingCellBase_3`
|
\cgalModels `RemeshingCellBase_3`
|
||||||
\cgalRefines `Triangulation_cell_base_with_info_3`
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
template<typename Gt,
|
template<typename Gt,
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,9 @@ namespace Tetrahedral_remeshing
|
||||||
\ingroup PkgTetrahedralRemeshingClasses
|
\ingroup PkgTetrahedralRemeshingClasses
|
||||||
|
|
||||||
The class `Remeshing_triangulation_3`
|
The class `Remeshing_triangulation_3`
|
||||||
is a class template which provides the triangulation type to be used
|
is a class template which provides a valid triangulation type
|
||||||
for the 3D triangulation
|
that can be used as the 3D triangulation input for
|
||||||
used in the tetrahedral remeshing process.
|
the tetrahedral remeshing process.
|
||||||
|
|
||||||
\tparam Gt is the geometric traits class.
|
\tparam Gt is the geometric traits class.
|
||||||
It has to be a model of the concept `RemeshingTriangulationTraits_3`.
|
It has to be a model of the concept `RemeshingTriangulationTraits_3`.
|
||||||
|
|
|
||||||
|
|
@ -29,17 +29,6 @@ namespace CGAL
|
||||||
{
|
{
|
||||||
namespace Tetrahedral_remeshing
|
namespace Tetrahedral_remeshing
|
||||||
{
|
{
|
||||||
namespace internal
|
|
||||||
{
|
|
||||||
class Fake_MD
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef int Index;
|
|
||||||
typedef int Surface_patch_index;
|
|
||||||
typedef int Subdomain_index;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\ingroup PkgTetrahedralRemeshingClasses
|
\ingroup PkgTetrahedralRemeshingClasses
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace CGAL
|
||||||
* in order to generate as output a high quality mesh with a prescribed density.
|
* in order to generate as output a high quality mesh with a prescribed density.
|
||||||
* These atomic operations are performed as follows :
|
* These atomic operations are performed as follows :
|
||||||
* - edge splits, until all edges satisfy a prescribed length criterion,
|
* - edge splits, until all edges satisfy a prescribed length criterion,
|
||||||
* - edge collapses, ntil all edges satisfy a prescribed length criterion,
|
* - edge collapses, until all edges satisfy a prescribed length criterion,
|
||||||
* - edge flips, to locally improve dihedral angles, until they can't be improved by flipping,
|
* - edge flips, to locally improve dihedral angles, until they can't be improved by flipping,
|
||||||
* - global smoothing by vertex relocations,
|
* - global smoothing by vertex relocations,
|
||||||
* - re-projection of boundary vertices to the initial surface.
|
* - re-projection of boundary vertices to the initial surface.
|
||||||
|
|
@ -82,7 +82,7 @@ namespace CGAL
|
||||||
* sequence of atomic operations
|
* sequence of atomic operations
|
||||||
* performed (listed in the above description)
|
* performed (listed in the above description)
|
||||||
* \cgalParamEnd
|
* \cgalParamEnd
|
||||||
* \cgalParamBegin{protect_boundaries} If `true`, none of the volume boundaries can be modified.
|
* \cgalParamBegin{remesh_boundaries} If `false`, none of the volume boundaries can be modified.
|
||||||
* Otherwise, the geometry is preserved, but atomic operations can be performed on the
|
* Otherwise, the geometry is preserved, but atomic operations can be performed on the
|
||||||
* surfaces, and along feature polylines.
|
* surfaces, and along feature polylines.
|
||||||
* \cgalParamEnd
|
* \cgalParamEnd
|
||||||
|
|
@ -151,8 +151,9 @@ namespace CGAL
|
||||||
using boost::choose_param;
|
using boost::choose_param;
|
||||||
using boost::get_param;
|
using boost::get_param;
|
||||||
|
|
||||||
bool protect = choose_param(get_param(np, internal_np::protect_boundaries),
|
bool remesh_surfaces = choose_param(get_param(np, internal_np::remesh_boundaries),
|
||||||
false);
|
true);
|
||||||
|
bool protect = !remesh_surfaces;
|
||||||
// bool adaptive = choose_param(get_param(np, internal_np::adaptive_size),
|
// bool adaptive = choose_param(get_param(np, internal_np::adaptive_size),
|
||||||
// false);
|
// false);
|
||||||
std::size_t max_it = choose_param(get_param(np, internal_np::number_of_iterations),
|
std::size_t max_it = choose_param(get_param(np, internal_np::number_of_iterations),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue