Having the limit surface the goal is now to generate a new triangular mesh over it, respecting a given mesh density distribution (typically prescribed at nodes of the control grid and/or curvature based) that makes the mesh suitable for subsequent computational analysis. The discretization is carried out in a hierarchical manner. Firstly, the model vertices are discretized. Then the (limit) curves are segmented using the mass curve of the required element density along that curve. And finally, the individual (limit) surfaces are triangulated.
In order to control the element size distribution, an octree is built around the domain to be discretized. The size of individual octants corresponds approximately to the required element spacing while the nodes (corners) of the octants are storing the required spacing exactly. To ensure the gradual variation of the element size, the maximum one-level octree difference of octants sharing an edge is enforced. This will guarantee creation of well shaped triangles. During the actual mesh generation the required element size is extracted from the octree for a given location using the interpolation of octree nodal values of the element size.
In the presented implementation, the surfaces are discretized by the advancing front technique constrained directly to the surface and modified to reflect surface curvature . Firstly, the initial front consisting of mesh edges at boundary curves of the surface (including inner loops) is established. Once the initial front has been set up, the mesh generation continues on the basis of an edge removal algorithm according to the following steps until the front becomes empty:
The generated mesh is then subjected to an optimization in order to improve the quality of the final mesh. The Laplacian smoothing technique in the combination with topological transformations (diagonal edge swapping) is adopted. This yields the optimized grid after only a few cycles of smoothing (typically up to six). Note that, contradictory to the smoothing carried out in 2D, the repositioning of a node during the smoothing is likely to shift the node out of the surface. Therefore, the node has to be projected back to the surface to satisfy the surface constraint.