Mesh Generation
Pierre Alliez
INRIA Sophia Antipolis - Mediterranee
Definitions
Mesh: Cellular complex partitioning an input domain into elementary cells.
Elementary cell: Admits a bounded description.
Cellular complex: Two cells are disjoint or share a lower dimensional face.
Variety
Domains: 2D, 3D, nD, surfaces, manifolds, periodic vs non-periodic, etc.
Variety
Elements: simplices (triangles, tetrahedra), quadrangles, polygons, hexahedra, arbitrary cells.
…
Variety
Structured mesh: All interior nodes have an equal number of adjacent elements.
Unstructured mesh: Any number of elements can meet at a single vertex.
Variety
Anisotropic vs Isotropic
Variety
Element distribution: Uniform vs adapted
Variety
Grading: Smooth vs fast
Required Properties
control/optimization over:
#elements
shape
orientation
size
grading
… (application dependent)
Mesh Generation
Input:
Domain boundary + internal constraints
Constraints
Sizing
Grading
Shape
Topology
…
2D Delaunay Refinement
2D Triangle Mesh Generation
Input:
PSLG C (planar straight line graph)
Domain bounded by edges of C
Output:
triangle mesh T of such that
vertices of C are vertices of T
edges of C are union of edges in T
triangles of T inside have controlled size and quality
Key Idea
Break bad elements by inserting circumcenters (Voronoi vertices) [Chew, Ruppert,
Shewchuk,...]
“bad” in terms of size or shape
Basic Notions
C: PSLG describing the constraints T: Triangulation to be refined
Respect of the PSLG
Edges a C are split until constrained subedges are edges of T
Constrained subedges are required to be Gabriel edges
An edge of a triangulation is a Gabriel edge if its smallest circumcirle encloses no vertex of T
An edge e is encroached by point p if the smallest circumcirle of e encloses p.
Refinement Algorithm
C: PSLG bounding the domain to be meshed.
T: Delaunay triangulation of the current set of vertices T|: T
Constrained subedges: subedges of edges of C
Initialise with T = Delaunay triangulation of vertices of C Refine until no rule apply
Rule 1
if there is an encroached constrained subedge e insert c = midpoint(e) in T (refine-edge)
Rule 2
if there is a bad facet f in T|
c = circumcenter(f)
if c encroaches a constrained subedge e refine-edge(e).
else
insert(c) in T
2D Delaunay Refinement
PSLG
Background
Constrained Delaunay Triangulation
Pseudo-dual: Bounded Voronoi Diagram
constrained Bounded Voronoi diagram
“blind” triangles
Delaunay Edge
An edge is said to be a Delaunay edge, if it is inscribed in an empty circle
Gabriel Edge
An edge is said to be a Gabriel edge, if its diametral circle is empty
Conforming Delaunay Triangulation
A constrained Delaunay triangulation is a conforming Delaunay triangulation, if every constrained edge is a Delaunay edge
non conforming conforming
Conforming Gabriel Triangulation
A constrained Delaunay triangulation is a conforming Gabriel triangulation, if every constrained edge is a Gabriel edge
non conforming conforming Gabriel
Steiner Vertices
Any constrained Delaunay triangulation can be refined into a conforming Delaunay or Gabriel triangulation by adding Steiner vertices.
non conforming conforming Gabriel
Delaunay Refinement
Rule #1: break bad elements by inserting circumcenters (Voronoi vertices)
“bad” in terms of size or shape (too big or skinny)
Picture taken from [Shewchuk]
Delaunay Refinement
Rule #2: Midpoint vertex insertion
A constrained segment is said to be encroached, if there is a vertex inside its diametral circle
Picture taken from [Shewchuk]
Delaunay Refinement
Encroached subsegments have priority over skinny triangles
Picture taken from [Shewchuk]
Surface Mesh Generation
Mesh Generation
Key concepts:
Voronoi/Delaunay filtering
Delaunay refinement
Voronoi Filtering
The Voronoi diagram restricted to a curve S, Vor|S(E), is the set of edges of Vor(E) that
intersect S.
S
Delaunay Filtering
The restricted Delaunay triangulation restricted to a curve S is the set of edges of the Delaunay triangulation whose dual edges intersect S.
(2D)
Delaunay Filtering
Dual Voronoi edge
Delaunay triangulation
restricted to surface S
facet
Voronoi edge surface S
Delaunay Refinement
Steiner point
Bad facet = big or
badly shaped or
large approximation error
Surface Mesh Generation Algorithm
repeat {
pick bad facet f
insert furthest (dual(f) S) in Delaunay triangulation update Delaunay triangulation restricted to S
}
until all facets are good
Surface Meshing at Work
Isosurface from 3D Grey Level Image
input
Output Mesh Properties
Termination Parsimony
Output mesh properties:
Well shaped triangles
Lower bound on triangle angles
Homeomorphic to input surface
Manifold
not only combinatorially, i.e., no self-intersection
Faithful Approximation of input surface
Hausdorff distance
Normals
Delaunay Refinement vs Marching Cubes
Delaunay refinement Marching cubes in octree
Guarantees
Volume Mesh Generation
Volume Meshing
Couple the latter algorithm with 3D Delaunay refinement
(insert circumcenters of “bad” tetrahedra)
Remove slivers at post-processing with sliver exudation
More Delaunay Filtering
Delaunay triangulation
restricted to domain
Dual Voronoi vertex inside domain
(“oracle”)
Delaunay Filtering
domain boundary
restricted Delaunay triangulation
3D Restricted Delaunay Triangulation
Delaunay Refinement
Steiner point
Volume Mesh Generation Algorithm
repeat {
pick bad simplex
if(Steiner point encroaches a facet)
refine facet else
refine simplex
update Delaunay triangulation restricted to domain
}
until all simplices are good Exude slivers
Delaunay Refinement
Example
Example
Multi-Domain Volume Mesh
Tetrahedron Zoo
Sliver
4 well-spaced vertices near the equator of their circumsphere
Slivers
Sliver Exudation
[Edelsbrunner-Guoy] Delaunay triangulation turned into a regular triangulation with null weights.
Small increase of weights triggers edge-facets flips to remove slivers.
Sliver Exudation Process
Try improving all tetrahedra with an aspect ratio lower than a given bound
Never flips a boundary facet
distribution of aspect ratios
Example Sliver Exudation
Piecewise Smooth Surfaces
Input: Piecewise smooth complex
More Delaunay Filtering
primitive dual of test against
Voronoi vertex tetrahedron inside domain
Voronoi edge facet intersect domain boundary Voronoi face edge intersect crease
Delaunay Refinement
Steiner points
Enrich Set of Rules…
Example
init 5 20
50 end slivers
Summary
Meshes
Definition, variety
Background
Voronoi
Delaunay
constrained Delaunay
restricted Delaunay
Generation
2D, 3D, Delaunay refinement
Mesh Optimization
Pierre Alliez
INRIA Sophia Antipolis - Mediterranee
Goals
3D simplicial mesh generation
optimize shape of elements
for matrix conditioning
isotropic
control over sizing
dictated by simulation
constrained by boundary
low number of elements desired
more elements = slower solution time
Popular Meshing Approaches
advancing front
specific subdivision
octree
lattice (e.g. body centered cubic)
Delaunay
refinement
sphere packing
spring energy
Laplacian
non-zero rest length
aspect / radius ratios
dihedral / solid angles
max-min/min-max
volumes
edge lengths
containing sphere radii [Freitag Amenta Bern Eppstein]
sliver exudation
[Edelsbrunner Goy]
combined with local optimizations
Variational?
Design one energy function such that good
solutions correspond to low energy ones (global minimum in general a mirage).
Solutions found by optimization techniques.
Example Energy in 2D
k
j x R
j
j
dx x
x E
..
1
||
2||
Lloyd Iteration
demo
2D Optimized Triangle Meshing
2D Optimized Triangle Meshing
Delaunay refinement
Termination
shape criterion: radius-edge ratio
in 2D: max 2 (implies min 20.7º)
in 3D: max 2 (nothing similar on dihedral angles)
[Chew, Ruppert, Shewchuk, ...]
Delaunay refinement
+ greedy (fast)
+ easy incorporation of sizing field + allows boundary conforming
possibly with Steiner points
even for sharp angles on boundary [Teng]
+ guaranteed bounds on radius-edge ratio - blind to slivers
- and experimentally...produces slivers
Background
Delaunay Triangulation
Duality on the paraboloid: Delaunay
triangulation obtained by projecting the lower part of the convex hull.
Delaunay Triangulation
Project the 2D point set
onto the 3D paraboloid
z=x2+y2
Compute the 3D
lower convex hull
z=x2+y2
Project the 3D facets
back to the plane.
z=x2+y2
Proof
The intersection of a plane with the paraboloid is an ellipse
whose projection to the plane is a circle.
s lies within the circumcircle of p, q, r iff s’ lies on the lower side of the plane passing through p’, q’, r’.
p, q, r S form a Delaunay
triangle iff p’, q’, r’ form a face of the convex hull of S’.
q p
r r’
q’ p’
s s’
Voronoi Diagram
Given a set S of points in the plane, associate with each point p=(a,b)S the plane
tangent to the paraboloid at p:
z = 2ax+2by-(a2+b2).
VD(S) is the projection to the (x,y) plane of the 1-skeleton of the convex polyhedron formed from the intersection of the halfspaces above these planes.
q p q’ p’
First Idea: Lloyd Algorithm
(after Lloyd relaxation)
...back to primal ?
Centroidal Voronoi Tessellation
distribution of radius ratios
1 0
Occurrences
220 “slivers”(tetswithradiusratio<0.2)
5K sites 30K tets
Tetrahedra Zoo
well-spaced points generate only round or sliver tetrahedra
Key Idea
adopt the "function approximation" point of view [Chen 04] Optimal Delaunay Triangulation
1D: f(x)=x2 centered at any vertex
minimize the L1 norm between f and PWL interpolation
Key Idea
3D: x2 (graph in IR4)
approximation theory:
linear interpolation: optimal shape of the element related to the Hessian of f [Shewchuk]
Hessian(x2) = Id
regular tetrahedron best
note: FE ~ mesh that best interpolates a function + matrix conditioning
Key Question
which mesh best approximates the paraboloid?
(PWL interpolates)
Answers:
for fixed point locations
Delaunay (lifts to lower facets of convex hull)
for fixed connectivity
quadratic energy
closed form for local optimum
Function Approximation
Given:
triangulation
bounded domain in IRn
Consider function approximation error:
||
,||
,) ,
,
(
pT L
f
If p
f T Q
linear interpolation
Function Approximation
Theorem [Chen 04]:
[d’Azevedo-Simpson 89] in IR2, p = [Rippa 92] in IR2, 1 p
[Melissaratos 93] in IRD, 1 p
Q T x p p p
x DT
Q
PV
T
( , || || , ), 1 min
) ,
||
||
,
(
2 2set of all triangulations with a given set V = convex hull of V
Isotropic function
Function Approximation
Let us V vary Problem:
find triangulation T* such that:
Proof:
existence
necessary condition for p=1
Q T f p p p
f T
Q
PN
T
inf ( , , ), 1 )
,
*, (
set of all triangulations with a at most N vertices
Function Approximation
Q T x p p p
x DT
Q
PV
T
( , || || , ), 1 min
) ,
||
||
,
(
2 2set of all triangulations with a given set V = convex hull of V
Isotropic function
(2D)
Function Approximation
xi: vertex
i: union of simplices incident to xi |A|: Lebesgue measure of set A in IRn
i
xi
Function Approximation
||
,||
,) ,
,
(
pT L
I
f
f p
f T Q
p p
T
I
x f x dx
f p
f T Q
/ 1
,
( ) ( ) |
| )
, ,
(
f x f x dx f
T
Q ( , , 1 ) (
I,T( ) ( ))
f x dx f x dx f
T
Q ( , , 1 )
I,T( ) ( )
f
convex,f
I,T PWL interpolantFunction Approximation
f x dx f x dx f
T
Q( , ,1) I,T ( ) ( )
f x dx f x dx
T
T
I, ( ) ( )
t t
f x k f x dx
n T
n
k
) ( )
, (
| 1 |
1 1
t t 1 t
f x f x dx
n xi T ( i ) | i | ( ) 1
1
n+1 overlaps
Function Approximation
i i i
dx x
f x
n f f
Q
x
i i
i ( ) | | ( )
1 ) 1
1 , , (
restrict to patch i incident to vertex xi
i xi
i i
j k j k i
dx x
f x
n f x
f
n x i
i x
x x
k
j ( ) ( )
1
| ) |
(
| ) ( 1 |
1
t t ,
t
constant
i
j k j k i
i i
x x x
k j
ODT x f x f x
E
t t
t ( ) | ( ) | | ( )
|
,
minimize
xk
Function Approximation
i
j k j k i
i i
x x x
k j
ODT x f x f x
E
t t
t ( )| ( )) | | ( ) (|
,
i
j xk j xk xi
k i
j i
i x f x
x f
t t
t
,
* | | ( ) ( )
|
| ) 1
(
||2
||
)
(x x
f
if
minimum if EODT 0
i
j xk j xk xi
k i
j i
i x x
x
t t
t
,
* 2
||
||
) (
|
| |
| 2
1
Geometric Interpretation
i j
j j
i
i
c
x
t
t |
| |
|
*
1
circumcenter
Note: optimal location depends only on the 1- ring neighbors, not on the current location. If all incident vertices lie on a common sphere, optimal location is at sphere center.
demo
Optimization
alternate updates of
connectivity
vertex location
both steps minimize the same energy
as for Lloyd iteration
for convex fixed boundary
energy monotonically decreases
convergence to a (local) minimum
Underlaid vs Overlaid Approximant
CVT
partition
approximant
compact Voronoi cells
isotropic sampling
ODT
overlapping decomposition
PWL interpolant
compact simplices
isotropic meshing
Optimization
Alternate updates of
connectivity (Delaunay triangulation)
vertex locations demo
Optimal Delaunay Triangulation
distribution of radius ratios 3 “slivers”,eachwithtwoverticesonboundary
Sizing Field
Goal reminder:
shape of elements
boundary approximation
minimize #elements
note: not independent (well-shape elements force K- Lipschitz sizing field [Ruppert, Miller et al.])
Proposal:
size <= lfs (local feature size) on boundary
sizing field = maximal K-Lipschitz
|| || ( )
inf )
( x K x y lfs y
y
Sizing Field
|| || ( )
inf )
( x K x y lfs y
y
K=1
Sizing Field: Examples
1 0.5
K=0.1
3 10 100
Algorithm
read input boundary
setup data structure & preprocessing
compute sizing field
generate initial sites inside
do
- Delaunay triangulation of {xi}
- move sites to optimal locations {xi*}
until convergence or stopping criterion
extract interior mesh
Input Boundary
surface triangle mesh
Requirements:
intersection free
closed
restricted Delaunay triangulation of the input
vertices [Oudot-Boissonnat, Cohen-Steiner et al.]
Input Boundary
[Oudot-Boissonnat]
Input Boundary
Setup & Preprocessing
Insertion of input mesh vertices to a 3D Delaunay triangulation
control mesh
used to answer inside/outside queries
?
?
Sizing Field: Poles
[Amenta-Bern 98]
control mesh
poles
Sizing Field: lfs
Approximation: distance to set of poles
CGAL orthogonal search in a kD-tree [Tangelder-Fabri]
Sizing Field: Examples
Approximation: fast marching from boundary Representation: regular grid or balanced octree
Optimization
classification boundary/interior vertices by localization of boundary in Voronoi cells
CVT on boundary
ODT inside
Optimization: init
0
Distribution of radius ratios
Optimization: step 1
1
Optimization: step 2
2
Optimization: step 50
50
Optimization: step 50
Optimization: step 50
Interior Mesh Extraction
Delaunay triangulation tessellates the convex hull
Hand: lfs
Hand: Sizing
Hand: Sizing
Hand: Sizing
Hand: Radius Ratios
Stanford Bunny
Stanford Bunny
Stanford Bunny
Stanford Bunny (uniform)
Torso
Torso
Torso
Torso
Torso
Joint
Conclusion
Meshes
Definition, variety
Background
Voronoi
Delaunay
constrained Delaunay
restricted Delaunay
Generation
2D, 3D, Delaunay refinement
Optimization
2D, 3D
Lloyd iteration, function approximation approach