\label{sec:remeshing} % few words on remeshing (why it became a key ingredient of mesh % processing). The process of replacing an arbitrary mesh by a faithful one with improved sampling, regularity and triangle quality is called remeshing. Most meshes, be they modeled or acquired by a scanning device, can be considerably improved this way in order to ease the visualization as well as the processing (see \cite{ss-dgp-01}). \cgal\ has proven successful at easing the combination of several components used for remeshing. We now give some details over the software components used for isotropic~\cite{acdi-isr-03} as well as for anisotropic remeshing~\cite{acdld-apr-03}. \subsubsection{Isotropic Remeshing} % isotropic remeshing, what for ? Isotropic remeshing leads to well-shaped triangles, and thus high-quality meshes for applications where the compactness of the mesh elements is critical. % main idea The main idea of the remeshing technique described in \cite{acdi-isr-03} is to cast the problem into the one of building a 2D centroidal Voronoi diagram over a set of newly sampled points. The key is to first parameterize the original mesh to obtain a bijective mapping and minimize the distortion due to the flattening process. The sampling and meshing stages are then considerably simpler on the planar parameter space (see Fig.~\ref{fig:isotropic}). % figure isotropic remeshing \begin{figure} \centering \epsfig{file=figs/isotropic.eps, width=\linewidth} \caption{Isotropic remeshing.} \label{fig:isotropic}\vspace{-3mm} \end{figure} % CGAL components Two key data structures from CGAL have been used to assemble the algorithm: \begin{itemize} \item The \cgalpoly\ has been used to represent the input mesh, after having enriched its primitives to store $u,v$ parameter coordinates per halfedge (hence per corner) in addition to the 3D coordinates per vertex. \item After initial sampling the \emph{2D constrained Delaunay triangulation} has been used together with Lloyd's clustering algorithm to build a weighted centroidal Voronoi diagram over the new sample points in parameter space. The fast point location in a triangulation provided by \cgal\ has been used to determine the final 3D coordinates of the sample points. \end{itemize} The \cgal\ geometric kernel is used as template parameter in these two data structures as well as in all algorithms involved in our remeshing technique (parameterization, error diffusion for sampling, Lloyd's clustering for sample placement and point location). The kernel thus nicely unifies all components of the algorithm and provides us with genericity for all simple geometric primitives and predicates. An important feature provided by \cgal\ is the \emph{filtered} kernel~\cite{bbp-iayed-01,p-iaeia-99}, which gives robustness required for complex models by mixing exact and floating point arithmetic in a transparent manner for the programmer. \subsubsection{Anisotropic Remeshing} % anisotropic remeshing, what for ? Beside quality of the mesh elements, remeshing is also concerned about approximation efficiency. When accurate representation is needed, a strategic sizing, alignment and aspect ratio of the mesh elements is crucial. This is a consequence of the natural anisotropic nature of generic surfaces. % main idea The main idea of the anisotropic remeshing technique described in \cite{acdld-apr-03} consists of tracing on anisotropic areas two orthogonal sets of streamlines in a conformal parameter space to align mesh edges along principal curvature lines and therefore respect the local symmetries. A careful control of the density of streamlines allows us to improve the mesh efficiency so as to match the optimality conditions for the $\L^2$ metric in the limit. On spherical areas the algorithm simply switches to isotropic point sampling strategy (see Fig.\ref{fig:anisotropic}). This remeshing technique produces quad-dominant meshes as illustrated by Fig.\ref{fig:trimming}. % figure anisotropic remeshing \begin{figure} \centering \epsfig{file=figs/anisotropic.eps, width=\linewidth} \caption{Lines of curvatures and umbilics.} \label{fig:anisotropic}\vspace{-3mm} \end{figure} % CGAL components As for the isotropic remeshing described above, the \cgalpoly\ has been used to represent the input mesh. Its primitives have been enriched so as to store two $u,v$ parameter coordinates per halfedge, and both 3D and 2D curvature tensors per vertex, or per halfedge on feature vertices. Extracting the new quad-dominant mesh is a fairly complex task since it has to be deduced from intersection, then straightening of streamlines. In anisotropic regions, we traced lines of curvature using polyline approximations while we used regular sample points on spherical regions. The \emph{vertices\/} will therefore be the intersections of curvature lines, and the isotropic samples that we spread. While the isotropic samples do not require any specific treatment, computing the line intersection has to be performed. In order to perform these intersections quickly, as well as to prepare the straightening stage, we make use of the 2D constrained Delaunay triangulation (CDT) from \cgal\ in parameter space. The key idea is to embed the quad-dominant polygon mesh within a triangulation through the constrained edges. We enter all the little segments defining the streamlines sequentially as constraints. Finally, the isotropic samples are added as vertices in the CDT. The vertices, intersection of streamlines, have \emph{automatically\/} been added to the CDT since two intersecting edge constraints will generate a vertex insertion. The edge-straightening stage is applied by repeatedly eliminating vertices from the triangulation while adding new constrained edges until only intersection and isotropic vertices remain (see Fig~.\ref{fig:trimming}).