namespace CGAL {
/*!

\mainpage User Manual
\anchor Chapter_Tetrahedral_Remeshing
\anchor userchaptertetrahedralremeshing

\cgalAutoToc
\authors Jane Tournois, Noura Faraj, Jean-Marc Thiery, Tamy Boubekeur

\image html bimba_back.png
\image latex bimba_back.png
<BR>

\section secTetRemeshing Multi-Material Isotropic Tetrahedral Remeshing

This package implements an algorithm for quality tetrahedral remeshing,
introduced by N.Faraj et al in \cgalCite{faraj2016mvr}.
This practical iterative remeshing algorithm is designed to remesh
multi-material tetrahedral meshes, by iteratively performing a sequence of
elementary operations such as edge splits, edge collapses, edge flips,
and vertex relocations following a Laplacian smoothing.
The algorithm results in high-quality uniform isotropic meshes,
with the desired mesh density,
while preserving the input geometric curve and surface features.

Specific remeshing rules have been designed to satisfy the following criteria.
First, the algorithm preserves the geometric complex topology, including
multi-material surface patches and polyline features. Polyline features
can be defined as intersections between more than two subdomains, or listed by
the user. Second, it has been made possible to remesh only a selection of cells,
instead of remeshing the whole domain, while preserving or remeshing the
interface surfaces between the preserved and the remeshed tetrahedra.

All the local atomic operations that are performed by the algorithm
preserve the input topology of the geometric complex.

The tetrahedral remeshing algorithm improves the quality of dihedral angles,
while targeting the user-defined uniform sizing field and preserving the
topology of the feature complex, as highlighted by Figure \cgalFigureRef{Remesh_liver}.

Experimental evidence shows that a higher number of remeshing iterations
leads to a mesh with a improved fidelity to the sizing criterion,
and higher quality dihedral angles.

\cgalFigureBegin{Remesh_liver, tetrahedral_remeshing_before_after.png}
Tetrahedral mesh, modified by our uniform tetrahedral remeshing method.
(Left) Before remeshing, dihedral angles were in the interval [1.3; 177.8].
(Right) After remeshing and keeping the same density,
dihedral angles are in the interval [12,7; 157.7].
\cgalFigureEnd


\section secTetRemeshingAPI API

The tetrahedral remeshing algorithm is implemented as a single free function
`CGAL::tetrahedral_isotropic_remeshing()` that
takes only two required parameters: the input triangulation, and the desired edge length,
which drives the remeshing process.

\ref BGLNamedParameters are used to deal with optional parameters.
The page \ref bgl_namedparameters describes their usage.

\section secTetRemeshingExamples Examples

\subsection ssecEx1 Tetrahedral Remeshing Example

The following example shows the simplest use of the tetrahedral remeshing function.
The only required parameter is a given target edge length that drives the remeshing process
towards a high-quality tetrahedral mesh with improved dihedral angles, and a more
uniform mesh, with edge lengths getting closer to the input parameter value.

\cgalExample{Tetrahedral_remeshing/tetrahedral_remeshing_example.cpp }


\subsection ssecEx2 Tetrahedral Remeshing of A Selection

Optional BGL named parameters offer more precise
control on the remeshing process. In this example, a triangulation with two subdomains
(defined by indices stored in cells) is given as input, but only one
(defined by the `Subdomain_index` 2)
of its subdomains is remeshed.

\cgalExample{Tetrahedral_remeshing/tetrahedral_remeshing_of_one_subdomain.cpp }


\subsection ssecEx3 Tetrahedral Remeshing With Polyline Features

Optional BGL named parameters offer more precise
control on the remeshing process. In this example, a triangulation
with polyline features that should be preserved - though resampled -
during the remeshing process, is given as input.
Preserving all surfaces exactly could also be achieved by
setting the named parameter `remesh_boundaries` to `false`.

\cgalExample{Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp }


\subsection ssecEx4 Tetrahedral Remeshing After Mesh Generation

The tetrahedral remeshing algorithm is designed as a post-processing for
mesh generation algorithms. The API allows to generate a tetrahedral mesh
with the \cgal \ref PkgMesh3 package, and
further improve it with the tetrahedral remeshing algorithm.
This example shows how to use tetrahedral mesh generation and remeshing in sequence,
from a polyhedral domain with features.

\cgalExample{Tetrahedral_remeshing/mesh_and_remesh_polyhedral_domain_with_features.cpp}


\subsection ssecEx5 Tetrahedral Remeshing from Any Tetrahedral Mesh

The following example shows how to read a mesh from a triangulation stored in a
Medit file, perform tetrahedral remeshing, and save the output triangulation.
The input triangulation should follow the validity requirements of a
`CGAL::Triangulation_3` (valid connectivity, positive orientation of the cells, and
coverage of the convex hull of the vertices).

\cgalExample{Tetrahedral_remeshing/tetrahedral_remeshing_from_mesh.cpp}


\section secTetRemeshingHistory Implementation History

This package implements the uniform version of the "Multi-Material Adaptive Volume Remesher"
algorithm for quality tetrahedral remeshing, described by Noura Faraj et al. in \cgalCite{faraj2016mvr}.

A first version of the code was written by Noura Faraj, Jean-Marc Thiery, and Tamy Boubekeur.
Jane Tournois worked on the finalization of the code, the API, and documentation.

It was initially published in CGAL-5.1.

*/
} /* namespace CGAL */
