doc fixes

This commit is contained in:
Laurent Rineau 2003-11-05 16:19:16 +00:00
parent 9fafab34aa
commit 743e287743
16 changed files with 320 additions and 518 deletions

View File

@ -4,50 +4,24 @@
\minitoc
This package implements Shewchuk's algorithm to construct conforming
triangulations and 2D meshes.
Conforming triangulations will be described in the
section~\ref{sec:Mesh_2_conforming_triangulation} and meshes in the
section~\ref{sec:Mesh_2_meshes}.
%\section{Definitions}
%\label{sec:Mesh_2_definitions}
%\begin{description}
%\item[Conforming triangulation] A conforming triangulation is a refinement
% of a constrained triangulation, obtained by inserting points (named
% \emph{Steiner points}) on constrained segments, so that the resulting
% triangulation is a \emph{Delaunay} or a \emph{Gabriel}
% triangulation. Delaunay triangulations are defined in the \cgal\ user
% manual of \ccc{Triangulation_2} package. A Gabriel triangulation of a
% sets of points and constrained segments is a constrained Delaunay
% triangulation with the extra following \emph{Gabriel property}: the
% \emph{diametral circle} of each constrained segments contains no point in
% its interior. The Gabriel property is stronger that the Delaunay property:
% a conforming Gabriel triangulation is also a conforming Delaunay
% triangulation.
%\item[Quality mesh] In this package, a quality mesh is a contrained
% Delaunay triangulation of a domain containing only triangles whose shapes
% and sizes satisfy several criterias.
%\end{description}
triangulations and 2D meshes. Conforming triangulations will be
described in the section~\ref{sec:Mesh_2_conforming_triangulation} and
meshes in the section~\ref{sec:Mesh_2_meshes}.
\section{Conforming triangulations}
\label{sec:Mesh_2_conforming_triangulation}
\subsection{Definition}
\label{sec:Mesh_2_conforming_defition}
\subsection{Definitions}
\label{sec:Mesh_2_conforming_definitions}
A constrained Delaunay triangulation is said to be a \emph{conforming
Delaunay triangulation} if every constrained edge is a Delaunay
edge, where we call {\em Delaunay edge} an edge that would appear
in the (unconstrained) Delaunay triangulation of the set of
vertices. Because any edge in a constrained Delaunay triangulation
is either a Delaunay edge or a constrained edge, a
conforming Delaunay triangulation is in fact
a Delaunay triangulation. The only difference
is that some of the edges are marked as constrained edges.
edge, where we call {\em Delaunay edge} an edge that would appear in
the (unconstrained) Delaunay triangulation of the set of vertices.
Because any edge in a constrained Delaunay triangulation is either a
Delaunay edge or a constrained edge, a conforming Delaunay
triangulation is in fact a Delaunay triangulation. The only difference
is that some of the edges are marked as constrained edges.
A constrained Delaunay triangulation is said to be a \emph{conforming
Gabriel triangulation} if every constrained edge is a Gabriel edge,
@ -57,10 +31,11 @@ the Delaunay property and each Gabriel edge is a Delaunay edge. Thus
conforming Gabriel triangulations are conforming Delaunay
triangulations.
Any contrained Delaunay triangulation can be refined into a conforming
Delaunay or conforming Gabriel triangulation by adding vertices,
called \emph{Steiner vertices}, on constrained edges until they are
cut into subconstraints small enough to be Delaunay or Gabriel edges.
Any constrained Delaunay triangulation can be refined into a
conforming Delaunay triangulation or a conforming Gabriel
triangulation by adding vertices, called \emph{Steiner vertices}, on
constrained edges until they are cut into subconstraints small enough
to be Delaunay or Gabriel edges.
\subsection{Building conforming triangulations}
\label{sec:Mesh_2_building_conforming}
@ -71,40 +46,34 @@ by two global functions: \\
\ccc{template<class CDT> void make_conforming_Delaunay_2 (CDT& t)} \\
\ccc{template<class CDT> void make_conforming_Gabriel_2 (CDT& t)}.
In both cases, the
template parameter \ccc{CDT} must be instanciated by a
constrained Delaunay triangulation class.
Such a class
can be either a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>} ) or
a derived class such as
\ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>}
where \ccc{CDT2} is a
In both cases, the template parameter \ccc{CDT} must be instantiated
by a constrained Delaunay triangulation class. Such a class can be
either a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>}) or a derived
class such as \ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>} where \ccc{CDT2} is
\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>}.
There are some requirements on the geometric traits od the
constrained Delaunay triangulation used to instantiate
the parameter \ccc{CDT}.
In case of \ccc{make_conforming_Delaunay_2 (CDT& t)}
he geometric traits has to be a model of the concept
\ccc{ConformingDelaunayTriangulationTraits_2} which refines
the traits \ccc{ConstrainedDelaunayTriangulationTraits_2}.
In case of \ccc{make_conforming_Gabriel_2 (CDT& t),
the geometric traits has to be a model of the concept
\ccc{ConformingGabrielTriangulationTraits_2}
There are some requirements on the geometric traits of the constrained
Delaunay triangulation used to instantiate the parameter \ccc{CDT}.
In case of \ccc{make_conforming_Delaunay_2 (CDT& t)} the geometric
traits has to be a model of the concept
\ccc{ConformingDelaunayTriangulationTraits_2} which refines the traits
\ccc{ConstrainedDelaunayTriangulationTraits_2}. In case of
\ccc{make_conforming_Gabriel_2 (CDT& t)}, the geometric traits has to
be a model of the concept \ccc{ConformingGabrielTriangulationTraits_2}
which further refines \ccc{ConformingDelaunayTriangulationTraits_2}.
The constrained Delaunay triangulation \ccc{t} is passed by reference
and is refined into a conforming Delaunay triangulation or
a conforming Gabriel triangulation by adding
vertices that is the triangulation is modified. If you want to keep
the original triangulation, please make a copy of it.
and is refined into a conforming Delaunay triangulation or a
conforming Gabriel triangulation by adding vertices, that is the
triangulation is modified. If you want to keep the original
triangulation, please make a copy of it.
The advanced user can also used the class
\ccc{Conforming_Delaunay_triangulation_2<CDT>} to refine
a constrained Delaunay triangulation into
a conforming Delaunay or a conforming Gabriel triangulation.
The advanced user can also use the class
\ccc{Conforming_Delaunay_triangulation_2<CDT>} to refine a constrained
Delaunay triangulation into a conforming Delaunay or a conforming
Gabriel triangulation.
\subsection{Example: making a triangulation conforming Delaunay and then
conforming Gabriel}
@ -125,12 +94,11 @@ printed.
\label{sec:Mesh_2_meshes_definition}
A mesh is a partition of a given domain into simplices, whose shapes
and sizes satisfy several criterias.
and sizes satisfy several criteria.
The domain to be mesh is bounded and can include internal
constraints to be respected.
Such a domain is defined by a \emph{planar straight
line graphes}, PSLG for short, and a set of seed points.
The domain to be mesh is bounded and can include internal constraints
to be respected. Such a domain is defined by a \emph{planar straight
line graphs}, PSLG for short, and a set of seed points.
A PSLG is a one dimensional simplicial complex, that
is a set of vertices and segments such that : \\
@ -140,79 +108,37 @@ set. \\
The segments of the PSLG described the boundaries and the internal
constraints of the domain.
The PSLG divides the plan into several connected components.
The domain is usually defined as the union of the
bounded connected components including
the seed points. Conversely, the seed points can be used to mark
the connected components which are outside the domain.
%Domains are unions of connected component of \emph{planar straight
% line graphes} (PSLG), which are sets of vertices and segments such
%that all endpoints of every segments are in the set and that segments
%intersect only at end-points. PSLG can represented by a \cgal\
%constrained triangulation, whose constrained segments are the segments
%of the domain.
%By default, the domain to be meshed is the whole plane but the
%connected component of the infinite vertex. If the domain is not
%bounded by a polyline of constrained segments, this domain can be
%empty and the meshing algorithm will not do anything.
%However, one can define more precisely which connected components of
%the PSLG are in the domain by setting \ccc{seeds}. Seeds are a set of
%points, that are not in the set of vertices of the triangulation. A
%boolean marker tells if the seeds are in the domain or not, and the
%connected component of each seed is marked the same way. Anyway, the
%(infinite) connected component of the infinite vertex is always marked
%as the exterior of the domain. By default, the set of seeds is empty,
%and the domain is the union of all finite connected components of the
%PSLG.
The PSLG divides the plan into several connected components. The
domain is usually defined as the union of the bounded connected
components including the seed points. Conversely, the seed points can
be used to mark the connected components which are outside the domain.
\new{If the set of seeds is empty, the domain is the union of the
bounded connected components.}
\subsection{Shape and size criteria}
\label{sec:Mesh_2_criteria}
The shape criteria on triangles is a lower bound $B$ on the ratio
between the circumradius and the shortest edge length.
Such a bound implies a lower bound of $\arcsin{\frac{1}{2B}}$
on the minimum angle of the triangle and an upper
bound of $\pi - 2* \arcsin{\frac{1}{2B}}$ on the maximun angle.
Unfortunalty, the
terminaison of the algorithm is guaranted only if $B \ge \sqrt{2}$
which corresponds to a lower bound of $20.7$~degrees
on the angles.
between the circumradius and the shortest edge length. Such a bound
implies a lower bound of $\arcsin{\frac{1}{2B}}$ on the minimum angle
of the triangle and an upper bound of $\pi - 2* \arcsin{\frac{1}{2B}}$
on the maximum angle. Unfortunately, the termination of the algorithm
is guaranteed only if $B \ge \sqrt{2}$ which corresponds to a lower
bound of $20.7$~degrees on the angles.
The size criteria can be any criteria that tends to prefer small
triangles. The size bound can be varying over the domain.
%should be that the circumradius is
%lower than a bound $B$ times the shortest edge of the triangle. This
%is equivalent to say that the minimum angle of the triangle is greater
%than $\arcsin{\frac{1}{2B}}$. If not angles are smaller than $\theta$,
%then no angles are greater than $\pi - \theta$. Unfortunalty, the
%terminaison of the algorithm is guaranted only if $B \ge \sqrt{2}$.
%This package cannot, for the moment, insure that angles of meshes are
%greater than $20.7$~degrees.
The size criteria can be any criteria that
tends to prefer small triangles.
The size bound can be varying over the domain.
Both types of criterias are defined
Both types of criteria are defined
in a nested type \ccc{Is_bad} of the geometric traits class.
\subsection{The meshing algorithm}
Thus, the input to a meshing problem is
a PSLG,
a set of seeds describing the domain to be meshed
and a set of valid size and shape criteria.
The algorithm implemented in this package
starts with a Constrained Delaunay triangulation
of the input PSLG and
produces a mesh
using the Delaunay refinement method.
The input to a meshing problem is a PSLG, a set of seeds
describing the domain to be meshed and a set of valid size and shape
criteria. The algorithm implemented in this package starts with a
constrained Delaunay triangulation of the input PSLG and produces a
mesh using the Delaunay refinement method.
If all angles between incident segments of the input PSLG
are greater than $60$~degrees, and if the bound on the
@ -220,118 +146,84 @@ circumradius/edge ratio is greater than $\sqrt{2}$
the algorithm is guaranteed to end up with a mesh
satisfying the size and shape criteria.
If some input
angles are smaller than $60$~degrees, the algorithm
will end up with a mesh in which some triangles
near small input angles violate the criteria.
This is unavoidable. Indeed small angles formed by input segments
cannot be suppressed. Furthermore,
it has been proved (\cite{s-mgdsa-00}),
that some domain with small input angles
cannot be meshed with angles even smaller that the small input
angles.
Note that if the domain is a polygonal region
the resulting mesh will satisfy size and shape criteria
except for the small input angles.
Note also that though it is not guaranteed, the algorithm may succeed
in achieving meshes with a lower angle bound
greater than $20.7$~degrees.
%that one cannot compute a triangular
%mesh the domain without adding even smaller angles in the mesh.
%because it has been proved
%that PSLG with small angles cannot be meshed without
%creating small angles.
% the criterias on angle and size are
%garanted to be fulfilled. If some input incident segments forme an
%angle smaller than $60$~degrees, these segments formed a
%\textit{cluster}. Near clusters, the algorithm cannot garanty the
%shape criterias. Of course small angles formed by input segments
%cannot be suppressed. What is more, if the domain is not a polygonal
%region, and includes angles smaller than $60$~degrees,
%\cite{s-mgdsa-00} has prooved that one cannot compute a triangular
%mesh the domain without inserting even smaller angles in the mesh.
%See~\cite{s-mgdsa-00} for details.
If some input angles are smaller than $60$~degrees, the algorithm will
end up with a mesh in which some triangles near small input angles
violate the criteria. This is unavoidable. Indeed small angles formed
by input segments cannot be suppressed. Furthermore, it has been
proved (\cite{s-mgdsa-00}), that some domains with small input angles
cannot be meshed with angles even smaller that the small input angles.
Note that if the domain is a polygonal region, the resulting mesh will
satisfy size and shape criteria except for the small input angles.
Note also that though it is not guaranteed, the algorithm may succeed
in achieving meshes with a lower angle bound greater than
$20.7$~degrees.
\subsection{Building meshes}
\label{sec:Mesh_2_building_meshes}
In this package, meshes are obtained from
In this package, meshes are obtained from
constrained Delaunay triangulation by calling the global function \\
\ccc{template<class CDT> void refine_Delaunay_mesh_2 (CDT &t, typename
CDT::Geom_traits gt)}. \\
They can also be obtained by using the class
\ccc{Delaunay_mesh_2<CDT>} that derives from \ccc{CDT}.
In both cases,
the template parameter \ccc{CDT} must be instanciated by a
constrained Delaunay triangulation class.
Such a class
can be either a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>} ) or
a derived class such as
\ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>}
where \ccc{CDT2} is a
\ccc{Delaunay_mesh_2<CDT>} that derives from \ccc{CDT}. In both
cases, the template parameter \ccc{CDT} must be instantiated by a
constrained Delaunay triangulation class. Such a class can be either
a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>} ) or a derived
class such as \ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>} where \ccc{CDT2} is a
\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>}.
The geometric traits class of the instance of \ccc{CDT}
has to be a model of the concept \ccc{DelaunayMeshTraits_2}.
The concept \ccc{DelaunayMeshTraits_2} refines the concept
\ccc{ConformingGabrielTriangulationTraits_2}
adding
the geometric criteria that the triangles have to satisfy.
\cgal provides models for this concept such as:
The geometric traits class of the instance of \ccc{CDT} has to be a
model of the concept \ccc{DelaunayMeshTraits_2}. \new{This concept}
refines the concept \ccc{ConformingGabrielTriangulationTraits_2}
adding the geometric criteria that the triangles have to satisfy.
\cgal\ provides models for this concept such as:
\begin{itemize}
\item \ccc{Delaunay_mesh_traits_2<K>} defines a shape criteria that
bounds the minimum angle of triangles.
\item \ccc{Delaunay_mesh_size_traits<K>} adds to the previous one a
bound on the maximum edge lenght.
\item \ccc{Delaunay_mesh_traits_2<K>}, that defines a shape criteria
that bounds the minimum angle of triangles,
\item \ccc{Delaunay_mesh_size_traits<K>}, that adds to the previous one a
bound on the maximum edge length.
\end{itemize}
The class \ccc{Delaunay_mesh_2<CDT>} derives from \ccc{CDT} and has
several member functions to define the domain and mesh it. See example
and the reference manual for details.
Note that the insertin of verices and constraints
is not overwritten,
thus any insertion will break the size and shape guarantee
of the mesh until a meshing
function is called again.
several member functions to define the domain and mesh it. See examples
and the reference manual for details. Note that the insertion of
vertices and constraints is not overwritten, thus any insertion will
break the size and shape guarantee of the mesh until a meshing
function is called again.
%If, after a call to one of the
%meshing function, one inserts vertices of constrained edges, the
%triangulation is no longer guaranted to be meshed and the meshing
%function should be called again.
\subsection{Example using the global function}
\subsection{Example using the global function and shape and size default
criterias}
The following example inserts several segments in a contrained
triangulation, then mesh it using the global function
\ccc{refine_Delaunay_mesh_2} and the default traits class.
\new{The following example inserts several segments in a constrained
triangulation, then mesh it using the global function
\ccc{refine_Delaunay_mesh_2}. The size and shape criteria are the
defaults provided by the traits class
\ccc{Delaunay_mesh_traits_2<K>}. No seeds are given, meaning that
the mesh domain covers all the plan except the unbounded component.}
\ccIncludeExampleCode{Mesh_2/mesh_global.C}
\subsection{Example using the class \ccc{Delaunay_mesh_2<CDT>} and several
criterias}
\subsection{Example using the class \ccc{Delaunay_mesh_2<CDT>}}
This example uses the class \ccc{Delaunay_mesh_2<CDT>} in order to refine
the mesh with new criterias, after the first meshing. One can use
\ccc{refine_Delaunay_mesh_2} twice, with different geometric traits class,
but it is less efficient, because some internal structures needed by the
algorithm are calculated twice.
\new{This example uses the class \ccc{Delaunay_mesh_2<CDT>} and calls
the \ccc{refine_mesh()} member function twice changing the size and
shape criteria inbetween. In such a case, using twice the global
function \ccc{refine_Delaunay_mesh_2} would be less efficient,
because some internal structures needed by the algorithm would be
calculated twice.}
\ccIncludeExampleCode{Mesh_2/mesh_class.C}
\todo{Exemple avec seeds.}
\subsection{Example using seeds}
\todo{Exemple avec la fonction globale.}
\new{Like the previous one, this example uses the class
\ccc{Delaunay_mesh_2<CDT>} but defines a domain by using one seed.
The size and shape criteria are the defaults provided by the traits
class \ccc{Delaunay_mesh_traits_2<K>}. }
\ccIncludeExampleCode{Mesh_2/mesh_global_with_seeds.C}
%%% For emacs/AucTeX:
%%% Local Variables: ***

View File

@ -13,6 +13,8 @@
\usepackage{ae}
\usepackage{color}
\usepackage[active]{srcltx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -88,10 +90,12 @@
% -------------------------------------------------------------
\ccDefGlobalScope{CGAL::}
%\reversemarginpar
\newcommand{\todo}[2][TODO]{\textbf{#1: #2}\marginpar{\textbf{#1}}}
\newcommand{\new}[1]{\textcolor{red}{#1}\marginpar{\textbf{NEW}}}
\begin{document}
\reversemarginpar
\newcommand{\todo}[2][TODO]{\marginpar{\textbf{#1}}\textbf{#1: #2}}
\lcHtml{\def\Input#1{\input{#1}} \def\todo#1{} \def\todo[#1]#2{}}
\Input{main}

View File

@ -2,12 +2,13 @@
\ccDefinition
In addition of the requirements of the concept
\ccc{DelaunayTriangulationTraits_2}, a model of the concept \ccRefName\ has
to provide a numeric field type \ccc{FT}, a type \ccc{Vector_2} and several
constructors on \ccc{Vector_2} and \ccc{Point_2}. These constructors are
used by the conforming algorithm to compute Steiner points on constrained
edges.
\new{The concept \ccRefName\ refines the concept
\ccc{ConstrainedDelaunayTriangulationTraits_2}, providing a numeric
field type \ccc{FT}, a type \ccc{Vector_2} and several constructors on
\ccc{Vector_2} and \ccc{Point_2}. The field type has to be a model of
the concept \ccc{SqrtFieldNumberType}. This field type and the
constructors are used by the conforming algorithm to compute Steiner
points on constrained edges.}
\ccRefines

View File

@ -1,14 +1,14 @@
\begin{ccRefConcept}{ConformingGabrielTriangulationTraits_2}
\ccRefines
\ccc{ConformingDelaunayTriangulationTraits_2}
\ccDefinition
In addition of the requirements of the concept
\ccc{ConformingDelaunayTriangulationTraits_2}, a model of the concept
\ccRefName\ has to provide a predicate on angles \ccc{Angle_2}.
\new{The concept \ccRefName\ refines the concept
\ccc{ConformingDelaunayTriangulationTraits_2}, providing a predicate
on angles \ccc{Angle_2}.}
\ccRefines
\new{\ccc{ConformingDelaunayTriangulationTraits_2}}
\ccTypes

View File

@ -2,13 +2,13 @@
\ccDefinition
The concept \ccRefName\ is an extension of the concept
\new{The concept \ccRefName\ is refines the concept
\ccc{TriangulationFaceBase_2}. It adds two functions giving access to
a boolean marker, that the meshing algorithm uses to set if the face
is in the meshing domain or not.
is in the meshing domain or not.}
\ccRefines
\ccc{TriangulationFaceBase_2}
\new{\ccc{ConstrainedTriangulationFaceBase_2}}
\ccCreationVariable{f}

View File

@ -1,19 +1,19 @@
\begin{ccRefConcept}{DelaunayMeshTraits_2}
\ccRefines
\ccc{ConformingGabrielTriangulationTraits_2}
\ccDefinition
In addition of the requirements of the concept
\ccc{ConformingGabrielTriangulationTraits_2}, a model of the concept
\ccRefName{} has to provide a type \ccc{Quality} that represents a
measure of the quality of a triangle, and a predicate \ccc{Is_bad}.
\ccc{Is_bad} defines mesh criteria on triangles and computes the
quality of the triangle passed as argument. The type \ccc{Quality}
must be \emph{comparable} as the meshing algorithm will order bad
triangles by quality, to split those with smallest quality first.
\new{The concept \ccRefName\ refines the concept
\ccc{ConformingGabrielTriangulationTraits_2}. It has to provides a
type \ccc{Quality} that represents a measure of the quality of a
triangle, and a predicate \ccc{Is_bad}. \ccc{Is_bad} defines mesh
criteria on triangles and computes the quality of the triangle passed
as argument. The type \ccc{Quality} must be \emph{comparable} as the
meshing algorithm will order bad triangles by quality, to split those
with smallest quality first.}
\ccRefines
\new{\ccc{ConformingGabrielTriangulationTraits_2}}
\ccTypes

View File

@ -11,10 +11,8 @@
\ccRefIdfierPage{CGAL::Delaunay_mesh_2<CDT>}\\
\ccRefIdfierPage{CGAL::Delaunay_mesh_face_base_2<Traits, Fb>}\\
\ccRefIdfierPage{CGAL::Delaunay_mesh_traits_2<K>}\\
\ccRefIdfierPage{CGAL::Delaunay_mesh_size_traits_2<K>}%
\begin{ccAdvanced}
\ccRefIdfierPage{CGAL::Conforming_Delaunay_triangulation_2<CDT>}\\
\end{ccAdvanced}
\ccRefIdfierPage{CGAL::Delaunay_mesh_size_traits_2<K>}\\
\ccRefIdfierPage{CGAL::Conforming_Delaunay_triangulation_2<CDT>}%
\subsection*{Global functions}
\ccRefIdfierPage{CGAL::make_conforming_Delaunay_2}\\

View File

@ -13,6 +13,8 @@
\usepackage{ae}
\usepackage{color}
\usepackage[active]{srcltx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -88,10 +90,14 @@
% -------------------------------------------------------------
\ccDefGlobalScope{CGAL::}
\newcommand{\todo}[2][TODO]{\marginpar{\textbf{#1}}\textbf{#1: #2}}
%\reversemarginpar
\newcommand{\todo}[2][TODO]{\textbf{#1: #2}\marginpar{\textbf{#1}}}
\newcommand{\new}[1]{\textcolor{red}{#1}\marginpar{\textbf{NEW}}}
\begin{document}
\lcHtml{\def\Input#1{\input{#1}} \def\todo#1{} \def\todo[#1]#2{}}
\Input{main}
%% \begin{ccTexOnly}

View File

@ -4,50 +4,24 @@
\minitoc
This package implements Shewchuk's algorithm to construct conforming
triangulations and 2D meshes.
Conforming triangulations will be described in the
section~\ref{sec:Mesh_2_conforming_triangulation} and meshes in the
section~\ref{sec:Mesh_2_meshes}.
%\section{Definitions}
%\label{sec:Mesh_2_definitions}
%\begin{description}
%\item[Conforming triangulation] A conforming triangulation is a refinement
% of a constrained triangulation, obtained by inserting points (named
% \emph{Steiner points}) on constrained segments, so that the resulting
% triangulation is a \emph{Delaunay} or a \emph{Gabriel}
% triangulation. Delaunay triangulations are defined in the \cgal\ user
% manual of \ccc{Triangulation_2} package. A Gabriel triangulation of a
% sets of points and constrained segments is a constrained Delaunay
% triangulation with the extra following \emph{Gabriel property}: the
% \emph{diametral circle} of each constrained segments contains no point in
% its interior. The Gabriel property is stronger that the Delaunay property:
% a conforming Gabriel triangulation is also a conforming Delaunay
% triangulation.
%\item[Quality mesh] In this package, a quality mesh is a contrained
% Delaunay triangulation of a domain containing only triangles whose shapes
% and sizes satisfy several criterias.
%\end{description}
triangulations and 2D meshes. Conforming triangulations will be
described in the section~\ref{sec:Mesh_2_conforming_triangulation} and
meshes in the section~\ref{sec:Mesh_2_meshes}.
\section{Conforming triangulations}
\label{sec:Mesh_2_conforming_triangulation}
\subsection{Definition}
\label{sec:Mesh_2_conforming_defition}
\subsection{Definitions}
\label{sec:Mesh_2_conforming_definitions}
A constrained Delaunay triangulation is said to be a \emph{conforming
Delaunay triangulation} if every constrained edge is a Delaunay
edge, where we call {\em Delaunay edge} an edge that would appear
in the (unconstrained) Delaunay triangulation of the set of
vertices. Because any edge in a constrained Delaunay triangulation
is either a Delaunay edge or a constrained edge, a
conforming Delaunay triangulation is in fact
a Delaunay triangulation. The only difference
is that some of the edges are marked as constrained edges.
edge, where we call {\em Delaunay edge} an edge that would appear in
the (unconstrained) Delaunay triangulation of the set of vertices.
Because any edge in a constrained Delaunay triangulation is either a
Delaunay edge or a constrained edge, a conforming Delaunay
triangulation is in fact a Delaunay triangulation. The only difference
is that some of the edges are marked as constrained edges.
A constrained Delaunay triangulation is said to be a \emph{conforming
Gabriel triangulation} if every constrained edge is a Gabriel edge,
@ -57,10 +31,11 @@ the Delaunay property and each Gabriel edge is a Delaunay edge. Thus
conforming Gabriel triangulations are conforming Delaunay
triangulations.
Any contrained Delaunay triangulation can be refined into a conforming
Delaunay or conforming Gabriel triangulation by adding vertices,
called \emph{Steiner vertices}, on constrained edges until they are
cut into subconstraints small enough to be Delaunay or Gabriel edges.
Any constrained Delaunay triangulation can be refined into a
conforming Delaunay triangulation or a conforming Gabriel
triangulation by adding vertices, called \emph{Steiner vertices}, on
constrained edges until they are cut into subconstraints small enough
to be Delaunay or Gabriel edges.
\subsection{Building conforming triangulations}
\label{sec:Mesh_2_building_conforming}
@ -71,40 +46,34 @@ by two global functions: \\
\ccc{template<class CDT> void make_conforming_Delaunay_2 (CDT& t)} \\
\ccc{template<class CDT> void make_conforming_Gabriel_2 (CDT& t)}.
In both cases, the
template parameter \ccc{CDT} must be instanciated by a
constrained Delaunay triangulation class.
Such a class
can be either a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>} ) or
a derived class such as
\ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>}
where \ccc{CDT2} is a
In both cases, the template parameter \ccc{CDT} must be instantiated
by a constrained Delaunay triangulation class. Such a class can be
either a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>}) or a derived
class such as \ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>} where \ccc{CDT2} is
\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>}.
There are some requirements on the geometric traits od the
constrained Delaunay triangulation used to instantiate
the parameter \ccc{CDT}.
In case of \ccc{make_conforming_Delaunay_2 (CDT& t)}
he geometric traits has to be a model of the concept
\ccc{ConformingDelaunayTriangulationTraits_2} which refines
the traits \ccc{ConstrainedDelaunayTriangulationTraits_2}.
In case of \ccc{make_conforming_Gabriel_2 (CDT& t),
the geometric traits has to be a model of the concept
\ccc{ConformingGabrielTriangulationTraits_2}
There are some requirements on the geometric traits of the constrained
Delaunay triangulation used to instantiate the parameter \ccc{CDT}.
In case of \ccc{make_conforming_Delaunay_2 (CDT& t)} the geometric
traits has to be a model of the concept
\ccc{ConformingDelaunayTriangulationTraits_2} which refines the traits
\ccc{ConstrainedDelaunayTriangulationTraits_2}. In case of
\ccc{make_conforming_Gabriel_2 (CDT& t)}, the geometric traits has to
be a model of the concept \ccc{ConformingGabrielTriangulationTraits_2}
which further refines \ccc{ConformingDelaunayTriangulationTraits_2}.
The constrained Delaunay triangulation \ccc{t} is passed by reference
and is refined into a conforming Delaunay triangulation or
a conforming Gabriel triangulation by adding
vertices that is the triangulation is modified. If you want to keep
the original triangulation, please make a copy of it.
and is refined into a conforming Delaunay triangulation or a
conforming Gabriel triangulation by adding vertices, that is the
triangulation is modified. If you want to keep the original
triangulation, please make a copy of it.
The advanced user can also used the class
\ccc{Conforming_Delaunay_triangulation_2<CDT>} to refine
a constrained Delaunay triangulation into
a conforming Delaunay or a conforming Gabriel triangulation.
The advanced user can also use the class
\ccc{Conforming_Delaunay_triangulation_2<CDT>} to refine a constrained
Delaunay triangulation into a conforming Delaunay or a conforming
Gabriel triangulation.
\subsection{Example: making a triangulation conforming Delaunay and then
conforming Gabriel}
@ -125,12 +94,11 @@ printed.
\label{sec:Mesh_2_meshes_definition}
A mesh is a partition of a given domain into simplices, whose shapes
and sizes satisfy several criterias.
and sizes satisfy several criteria.
The domain to be mesh is bounded and can include internal
constraints to be respected.
Such a domain is defined by a \emph{planar straight
line graphes}, PSLG for short, and a set of seed points.
The domain to be mesh is bounded and can include internal constraints
to be respected. Such a domain is defined by a \emph{planar straight
line graphs}, PSLG for short, and a set of seed points.
A PSLG is a one dimensional simplicial complex, that
is a set of vertices and segments such that : \\
@ -140,79 +108,37 @@ set. \\
The segments of the PSLG described the boundaries and the internal
constraints of the domain.
The PSLG divides the plan into several connected components.
The domain is usually defined as the union of the
bounded connected components including
the seed points. Conversely, the seed points can be used to mark
the connected components which are outside the domain.
%Domains are unions of connected component of \emph{planar straight
% line graphes} (PSLG), which are sets of vertices and segments such
%that all endpoints of every segments are in the set and that segments
%intersect only at end-points. PSLG can represented by a \cgal\
%constrained triangulation, whose constrained segments are the segments
%of the domain.
%By default, the domain to be meshed is the whole plane but the
%connected component of the infinite vertex. If the domain is not
%bounded by a polyline of constrained segments, this domain can be
%empty and the meshing algorithm will not do anything.
%However, one can define more precisely which connected components of
%the PSLG are in the domain by setting \ccc{seeds}. Seeds are a set of
%points, that are not in the set of vertices of the triangulation. A
%boolean marker tells if the seeds are in the domain or not, and the
%connected component of each seed is marked the same way. Anyway, the
%(infinite) connected component of the infinite vertex is always marked
%as the exterior of the domain. By default, the set of seeds is empty,
%and the domain is the union of all finite connected components of the
%PSLG.
The PSLG divides the plan into several connected components. The
domain is usually defined as the union of the bounded connected
components including the seed points. Conversely, the seed points can
be used to mark the connected components which are outside the domain.
\new{If the set of seeds is empty, the domain is the union of the
bounded connected components.}
\subsection{Shape and size criteria}
\label{sec:Mesh_2_criteria}
The shape criteria on triangles is a lower bound $B$ on the ratio
between the circumradius and the shortest edge length.
Such a bound implies a lower bound of $\arcsin{\frac{1}{2B}}$
on the minimum angle of the triangle and an upper
bound of $\pi - 2* \arcsin{\frac{1}{2B}}$ on the maximun angle.
Unfortunalty, the
terminaison of the algorithm is guaranted only if $B \ge \sqrt{2}$
which corresponds to a lower bound of $20.7$~degrees
on the angles.
between the circumradius and the shortest edge length. Such a bound
implies a lower bound of $\arcsin{\frac{1}{2B}}$ on the minimum angle
of the triangle and an upper bound of $\pi - 2* \arcsin{\frac{1}{2B}}$
on the maximum angle. Unfortunately, the termination of the algorithm
is guaranteed only if $B \ge \sqrt{2}$ which corresponds to a lower
bound of $20.7$~degrees on the angles.
The size criteria can be any criteria that tends to prefer small
triangles. The size bound can be varying over the domain.
%should be that the circumradius is
%lower than a bound $B$ times the shortest edge of the triangle. This
%is equivalent to say that the minimum angle of the triangle is greater
%than $\arcsin{\frac{1}{2B}}$. If not angles are smaller than $\theta$,
%then no angles are greater than $\pi - \theta$. Unfortunalty, the
%terminaison of the algorithm is guaranted only if $B \ge \sqrt{2}$.
%This package cannot, for the moment, insure that angles of meshes are
%greater than $20.7$~degrees.
The size criteria can be any criteria that
tends to prefer small triangles.
The size bound can be varying over the domain.
Both types of criterias are defined
Both types of criteria are defined
in a nested type \ccc{Is_bad} of the geometric traits class.
\subsection{The meshing algorithm}
Thus, the input to a meshing problem is
a PSLG,
a set of seeds describing the domain to be meshed
and a set of valid size and shape criteria.
The algorithm implemented in this package
starts with a Constrained Delaunay triangulation
of the input PSLG and
produces a mesh
using the Delaunay refinement method.
The input to a meshing problem is a PSLG, a set of seeds
describing the domain to be meshed and a set of valid size and shape
criteria. The algorithm implemented in this package starts with a
constrained Delaunay triangulation of the input PSLG and produces a
mesh using the Delaunay refinement method.
If all angles between incident segments of the input PSLG
are greater than $60$~degrees, and if the bound on the
@ -220,118 +146,84 @@ circumradius/edge ratio is greater than $\sqrt{2}$
the algorithm is guaranteed to end up with a mesh
satisfying the size and shape criteria.
If some input
angles are smaller than $60$~degrees, the algorithm
will end up with a mesh in which some triangles
near small input angles violate the criteria.
This is unavoidable. Indeed small angles formed by input segments
cannot be suppressed. Furthermore,
it has been proved (\cite{s-mgdsa-00}),
that some domain with small input angles
cannot be meshed with angles even smaller that the small input
angles.
Note that if the domain is a polygonal region
the resulting mesh will satisfy size and shape criteria
except for the small input angles.
Note also that though it is not guaranteed, the algorithm may succeed
in achieving meshes with a lower angle bound
greater than $20.7$~degrees.
%that one cannot compute a triangular
%mesh the domain without adding even smaller angles in the mesh.
%because it has been proved
%that PSLG with small angles cannot be meshed without
%creating small angles.
% the criterias on angle and size are
%garanted to be fulfilled. If some input incident segments forme an
%angle smaller than $60$~degrees, these segments formed a
%\textit{cluster}. Near clusters, the algorithm cannot garanty the
%shape criterias. Of course small angles formed by input segments
%cannot be suppressed. What is more, if the domain is not a polygonal
%region, and includes angles smaller than $60$~degrees,
%\cite{s-mgdsa-00} has prooved that one cannot compute a triangular
%mesh the domain without inserting even smaller angles in the mesh.
%See~\cite{s-mgdsa-00} for details.
If some input angles are smaller than $60$~degrees, the algorithm will
end up with a mesh in which some triangles near small input angles
violate the criteria. This is unavoidable. Indeed small angles formed
by input segments cannot be suppressed. Furthermore, it has been
proved (\cite{s-mgdsa-00}), that some domains with small input angles
cannot be meshed with angles even smaller that the small input angles.
Note that if the domain is a polygonal region, the resulting mesh will
satisfy size and shape criteria except for the small input angles.
Note also that though it is not guaranteed, the algorithm may succeed
in achieving meshes with a lower angle bound greater than
$20.7$~degrees.
\subsection{Building meshes}
\label{sec:Mesh_2_building_meshes}
In this package, meshes are obtained from
In this package, meshes are obtained from
constrained Delaunay triangulation by calling the global function \\
\ccc{template<class CDT> void refine_Delaunay_mesh_2 (CDT &t, typename
CDT::Geom_traits gt)}. \\
They can also be obtained by using the class
\ccc{Delaunay_mesh_2<CDT>} that derives from \ccc{CDT}.
In both cases,
the template parameter \ccc{CDT} must be instanciated by a
constrained Delaunay triangulation class.
Such a class
can be either a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>} ) or
a derived class such as
\ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>}
where \ccc{CDT2} is a
\ccc{Delaunay_mesh_2<CDT>} that derives from \ccc{CDT}. In both
cases, the template parameter \ccc{CDT} must be instantiated by a
constrained Delaunay triangulation class. Such a class can be either
a plain constrained Delaunay triangulation
(\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>} ) or a derived
class such as \ccc{Constrained_triangulation_plus_2<CDT2>} or
\ccc{Triangulation_hierarchy_2<CDT2>} where \ccc{CDT2} is a
\ccc{Constrained_Delaunay_triangulation_2<Gt, Tds>}.
The geometric traits class of the instance of \ccc{CDT}
has to be a model of the concept \ccc{DelaunayMeshTraits_2}.
The concept \ccc{DelaunayMeshTraits_2} refines the concept
\ccc{ConformingGabrielTriangulationTraits_2}
adding
the geometric criteria that the triangles have to satisfy.
\cgal provides models for this concept such as:
The geometric traits class of the instance of \ccc{CDT} has to be a
model of the concept \ccc{DelaunayMeshTraits_2}. \new{This concept}
refines the concept \ccc{ConformingGabrielTriangulationTraits_2}
adding the geometric criteria that the triangles have to satisfy.
\cgal\ provides models for this concept such as:
\begin{itemize}
\item \ccc{Delaunay_mesh_traits_2<K>} defines a shape criteria that
bounds the minimum angle of triangles.
\item \ccc{Delaunay_mesh_size_traits<K>} adds to the previous one a
bound on the maximum edge lenght.
\item \ccc{Delaunay_mesh_traits_2<K>}, that defines a shape criteria
that bounds the minimum angle of triangles,
\item \ccc{Delaunay_mesh_size_traits<K>}, that adds to the previous one a
bound on the maximum edge length.
\end{itemize}
The class \ccc{Delaunay_mesh_2<CDT>} derives from \ccc{CDT} and has
several member functions to define the domain and mesh it. See example
and the reference manual for details.
Note that the insertin of verices and constraints
is not overwritten,
thus any insertion will break the size and shape guarantee
of the mesh until a meshing
function is called again.
several member functions to define the domain and mesh it. See examples
and the reference manual for details. Note that the insertion of
vertices and constraints is not overwritten, thus any insertion will
break the size and shape guarantee of the mesh until a meshing
function is called again.
%If, after a call to one of the
%meshing function, one inserts vertices of constrained edges, the
%triangulation is no longer guaranted to be meshed and the meshing
%function should be called again.
\subsection{Example using the global function}
\subsection{Example using the global function and shape and size default
criterias}
The following example inserts several segments in a contrained
triangulation, then mesh it using the global function
\ccc{refine_Delaunay_mesh_2} and the default traits class.
\new{The following example inserts several segments in a constrained
triangulation, then mesh it using the global function
\ccc{refine_Delaunay_mesh_2}. The size and shape criteria are the
defaults provided by the traits class
\ccc{Delaunay_mesh_traits_2<K>}. No seeds are given, meaning that
the mesh domain covers all the plan except the unbounded component.}
\ccIncludeExampleCode{Mesh_2/mesh_global.C}
\subsection{Example using the class \ccc{Delaunay_mesh_2<CDT>} and several
criterias}
\subsection{Example using the class \ccc{Delaunay_mesh_2<CDT>}}
This example uses the class \ccc{Delaunay_mesh_2<CDT>} in order to refine
the mesh with new criterias, after the first meshing. One can use
\ccc{refine_Delaunay_mesh_2} twice, with different geometric traits class,
but it is less efficient, because some internal structures needed by the
algorithm are calculated twice.
\new{This example uses the class \ccc{Delaunay_mesh_2<CDT>} and calls
the \ccc{refine_mesh()} member function twice changing the size and
shape criteria inbetween. In such a case, using twice the global
function \ccc{refine_Delaunay_mesh_2} would be less efficient,
because some internal structures needed by the algorithm would be
calculated twice.}
\ccIncludeExampleCode{Mesh_2/mesh_class.C}
\todo{Exemple avec seeds.}
\subsection{Example using seeds}
\todo{Exemple avec la fonction globale.}
\new{Like the previous one, this example uses the class
\ccc{Delaunay_mesh_2<CDT>} but defines a domain by using one seed.
The size and shape criteria are the defaults provided by the traits
class \ccc{Delaunay_mesh_traits_2<K>}. }
\ccIncludeExampleCode{Mesh_2/mesh_global_with_seeds.C}
%%% For emacs/AucTeX:
%%% Local Variables: ***

View File

@ -13,6 +13,8 @@
\usepackage{ae}
\usepackage{color}
\usepackage[active]{srcltx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -88,10 +90,12 @@
% -------------------------------------------------------------
\ccDefGlobalScope{CGAL::}
%\reversemarginpar
\newcommand{\todo}[2][TODO]{\textbf{#1: #2}\marginpar{\textbf{#1}}}
\newcommand{\new}[1]{\textcolor{red}{#1}\marginpar{\textbf{NEW}}}
\begin{document}
\reversemarginpar
\newcommand{\todo}[2][TODO]{\marginpar{\textbf{#1}}\textbf{#1: #2}}
\lcHtml{\def\Input#1{\input{#1}} \def\todo#1{} \def\todo[#1]#2{}}
\Input{main}

View File

@ -2,12 +2,13 @@
\ccDefinition
In addition of the requirements of the concept
\ccc{DelaunayTriangulationTraits_2}, a model of the concept \ccRefName\ has
to provide a numeric field type \ccc{FT}, a type \ccc{Vector_2} and several
constructors on \ccc{Vector_2} and \ccc{Point_2}. These constructors are
used by the conforming algorithm to compute Steiner points on constrained
edges.
\new{The concept \ccRefName\ refines the concept
\ccc{ConstrainedDelaunayTriangulationTraits_2}, providing a numeric
field type \ccc{FT}, a type \ccc{Vector_2} and several constructors on
\ccc{Vector_2} and \ccc{Point_2}. The field type has to be a model of
the concept \ccc{SqrtFieldNumberType}. This field type and the
constructors are used by the conforming algorithm to compute Steiner
points on constrained edges.}
\ccRefines

View File

@ -1,14 +1,14 @@
\begin{ccRefConcept}{ConformingGabrielTriangulationTraits_2}
\ccRefines
\ccc{ConformingDelaunayTriangulationTraits_2}
\ccDefinition
In addition of the requirements of the concept
\ccc{ConformingDelaunayTriangulationTraits_2}, a model of the concept
\ccRefName\ has to provide a predicate on angles \ccc{Angle_2}.
\new{The concept \ccRefName\ refines the concept
\ccc{ConformingDelaunayTriangulationTraits_2}, providing a predicate
on angles \ccc{Angle_2}.}
\ccRefines
\new{\ccc{ConformingDelaunayTriangulationTraits_2}}
\ccTypes

View File

@ -2,13 +2,13 @@
\ccDefinition
The concept \ccRefName\ is an extension of the concept
\new{The concept \ccRefName\ is refines the concept
\ccc{TriangulationFaceBase_2}. It adds two functions giving access to
a boolean marker, that the meshing algorithm uses to set if the face
is in the meshing domain or not.
is in the meshing domain or not.}
\ccRefines
\ccc{TriangulationFaceBase_2}
\new{\ccc{ConstrainedTriangulationFaceBase_2}}
\ccCreationVariable{f}

View File

@ -1,19 +1,19 @@
\begin{ccRefConcept}{DelaunayMeshTraits_2}
\ccRefines
\ccc{ConformingGabrielTriangulationTraits_2}
\ccDefinition
In addition of the requirements of the concept
\ccc{ConformingGabrielTriangulationTraits_2}, a model of the concept
\ccRefName{} has to provide a type \ccc{Quality} that represents a
measure of the quality of a triangle, and a predicate \ccc{Is_bad}.
\ccc{Is_bad} defines mesh criteria on triangles and computes the
quality of the triangle passed as argument. The type \ccc{Quality}
must be \emph{comparable} as the meshing algorithm will order bad
triangles by quality, to split those with smallest quality first.
\new{The concept \ccRefName\ refines the concept
\ccc{ConformingGabrielTriangulationTraits_2}. It has to provides a
type \ccc{Quality} that represents a measure of the quality of a
triangle, and a predicate \ccc{Is_bad}. \ccc{Is_bad} defines mesh
criteria on triangles and computes the quality of the triangle passed
as argument. The type \ccc{Quality} must be \emph{comparable} as the
meshing algorithm will order bad triangles by quality, to split those
with smallest quality first.}
\ccRefines
\new{\ccc{ConformingGabrielTriangulationTraits_2}}
\ccTypes

View File

@ -11,10 +11,8 @@
\ccRefIdfierPage{CGAL::Delaunay_mesh_2<CDT>}\\
\ccRefIdfierPage{CGAL::Delaunay_mesh_face_base_2<Traits, Fb>}\\
\ccRefIdfierPage{CGAL::Delaunay_mesh_traits_2<K>}\\
\ccRefIdfierPage{CGAL::Delaunay_mesh_size_traits_2<K>}%
\begin{ccAdvanced}
\ccRefIdfierPage{CGAL::Conforming_Delaunay_triangulation_2<CDT>}\\
\end{ccAdvanced}
\ccRefIdfierPage{CGAL::Delaunay_mesh_size_traits_2<K>}\\
\ccRefIdfierPage{CGAL::Conforming_Delaunay_triangulation_2<CDT>}%
\subsection*{Global functions}
\ccRefIdfierPage{CGAL::make_conforming_Delaunay_2}\\

View File

@ -13,6 +13,8 @@
\usepackage{ae}
\usepackage{color}
\usepackage[active]{srcltx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -88,10 +90,14 @@
% -------------------------------------------------------------
\ccDefGlobalScope{CGAL::}
\newcommand{\todo}[2][TODO]{\marginpar{\textbf{#1}}\textbf{#1: #2}}
%\reversemarginpar
\newcommand{\todo}[2][TODO]{\textbf{#1: #2}\marginpar{\textbf{#1}}}
\newcommand{\new}[1]{\textcolor{red}{#1}\marginpar{\textbf{NEW}}}
\begin{document}
\lcHtml{\def\Input#1{\input{#1}} \def\todo#1{} \def\todo[#1]#2{}}
\Input{main}
%% \begin{ccTexOnly}