Constrained Delaunay Triangulation (CDT) (Trianguleringer med føringer)

advertisement
Constrained Delaunay Triangulation (CDT)
(Trianguleringer med føringer)
Øyvind Hjelle
oyvindhj@simula.no, +47 67 82 82 75
Simula Research Laboratory, www.simula.no
October 12, 2009
Motivation
Recall:
“Definition 1” (Constrained triangulation). A triangulation ∆ with
prespecified edges or breaklines between nodes.
Motivation:
Geological faults in oil recovery
Rivers, roads, lake boundaries in GIT
Repr. non-convex boundaries and holes
Linear features in CAD models
Meshing for FEM (boundaries, interior & exterior)
Recall algorithm III from Preliminaries
Given a predefined constraint ei,j where the end points pi and pj
are in ∆.
1
For all ti in ∆,
If (Int(ti ) ∩ eij 6= φ),
remove ti from ∆
We get one or more regions Ri on each side of ei,j inside
simple closed polygon. (More than one if ei,j intersects
nodes.)
2
Triangulate each region Ri with Algorithm I (Protruding
point removal).
We may also include holes and an arbitrary exterior boundary (e.g.
one that is not convex).
(a)
ei,j
pj
pi
(b)
ei,j
pi
pj
Delaunay Triangulation of a PSLG
Generalization:
We will now generalize the theory of Delaunay triangulation from
∆(P ) to ∆(G) where G = G(P, Ec ) is a PSLG (Planar Straight
Line Graph).
Ec are constrained edges. The endpoints of Ec are in P .
Recall fom conventional Delaunay triangulations:
MaxMin angle criterion:
→Lexicographical ordering of indicator vectors
→Definition of local- and global optimum
The circle criterion (will now be modified)
The dual (Voronoi diagram) will not be considered here!
(involved and not so useful)
Definition (Visibility)
pi and pj are visible to each other iff pi pj does not intersect the
interior of any edge in Ec .
Definition (CDT)
A CDT ∆(G) of a PSLG G(P, Ec ) is a triangulation containing
the edges Ec such that the circumcircle C(t) of any triangle t in
∆(G) contains no point of P in its interior which is visible from all
the three nodes of t.
↑
DEFINITION: Modified circle criterion (relaxed)
Definition
Edges in ∆(G) that are not in Ec are called Delaunay edges;
triangles in ∆(G) are called Delaunay triangles.
(a)
(b)
(c)
(d)
a) G(P, Ec)
b) DT (P )
c) and d) CDT (G)
if Ec == φ then G = P and ∆(G) = ∆(P, φ) = ∆(P );
that is: a conventional Delaunay triangulation.
Generalization of the theory to CDTs
(Brief, consult cited papers for details)
(a)
p2
(b)
e
θ2
e'
θ1
e'
p1
p3
θ2
p4
e′ is constrained in (b).
Lemma
The modified circle criterion and the MaxMin angle criterion are
equivalent for strictly convex quadrilaterals.
Recall: indicator vector, lexicographical measure, ...
Lemma (⋆)
The indicator vector (of a constrained triangulation) becomes
lexicographically larger each time an edge of a strictly convex
quadrilateral is swapped according to the Delaunay swapping
criteria. (Basis for Lawson’s LOP Algorithm.)
LOP applied to a ∆(G), where G is a PSLG:
1
2
Start with an arbitrary ∆(G)
Repeat swapping of edges according to the modified circle
criterion
Does the LOP converge when applied to ∆(G)?
What does it converge to?
Do we reach a global optimum?
Lemma (⋆) and the fact that the number of possible triangulations
of G is finite guarantees that the algorithm terminates after a
finite number of edge swaps.
↓
Definition (Locally optimal edge:)
1
When the decision is not to swap it in the LOP.
2
Edges in Ec and boundary edges are locally optimal by default.
and Locally optimal triangulation is defined accordingly.
Theorem
All interior edges of a triangulation ∆(G) (G == G(P, Ec )) are
locally optimal
m (if and only if)
the modified circle criterion holds for all triangles.
Proof.
See Exercise in lecture notes.
Therefore, LOP yields a CDT in accordance with
DEFINITION (CDT).
Theorem
A triangulation ∆(G) is a CDT in accordance with
DEFINITION (CDT)
m (if and only if)
its indicator vector is lexicographically maximum.
Proof.
See Exercise with guidelines in lecture notes. (The proof is difficult
since the dual (Voronoi) cannot be used as for conventional
Delaunay triangulations.
↓
Uniqueness of a CDT can be deduced from the proof (under the
usual assumption that no four points of P are cocircular).
Unique characterization of Delaunay edge and Delaunay triangle in
a CDT (Recall, edges in Ec are not Delaunay edges):
Theorem (Delaunay edge)
Edge eij between points pi and pj of P is Delaunay
m (if and only if)
pi and pj are visible to each other and there exists a circle passing
through pi and pj that does not contain any points of P in its
interior visible from both pi and pj .
Proof.
See Exercise in lecture notes.
Theorem (Delaunay triangle)
Triangle t with nodes pi , pj and pk is Delaunay
m (if and only if)
C(t) contains no point of P in its interior which is visible from
both pi , pj and pk .
Proof.
See Exercise in lecture notes.
Algorithms for Constrained Delaunay Triangulation
Overview:
Similar schemes as for conventional Delaunay, but
1
predefined constrained edges, and
2
modified circle criterion.
Only incremental algorithms are considered here; basic operations:
inserting a constrained edge into a CDT, and
inserting a node into a CDT.
algorithms...
Given a PSLG G(P, Ec ) where endpoints of Ec are in P .
Algorithm (Compute ∆(G)):
1
Compute ∆(P, φ) (conventional Delaunay)
2
for each e in Ec
insert e into ∆(P, Ec′ ) and update to a CDT.
Ec′ ← Ec′ ∪ e
3
(add additional points into ∆(G))
Recall from conventional Delaunay triangulations:
Two schemes for inserting a point p:
a) remove triangles in (star shaped) influence region Rp and
retriangulate
b) split t which contains the insertion point into three new
triangles and apply recSwap procedure three times.
Inserting an Edge into a CDT
“Insert” constrained edge ec between pa and pb in
∆(P, Ec ) → ∆(P, Ec ∪ ec ).
(a)
ec
pa
pb
Q e ,L
c
(b)
ec
pa
pb
Q e ,R
c
Influence region Rec of ec in ∆(G) are triangles intersected by ec .
Note that no node is inserted or moved =⇒ only Rec is affected!
(Recall Theorem that characterizes a Delaunay edge.)
Influence polygons Qec ,L and Qec ,R on each side of ec .
Obtain ∆(P, Ec ∪ ec ) by triangulating Qec ,L and Qec ,R on each
side of the constrained edge ec separately using the modified circle
criterion:
“Step-by-step” approach with base line and growing circles:
Algorithm (Retriangulate Qec ,L or Qec ,R :)
1
Let ec be the first baseline
2
Start with a growing circle with r = ∞ and grow it into Q.
3
Make a triangle t with the first point p reached that is not
separated from ec with a constraint.
4
Chose a new base line ec (an edge of t) and use the same
circle.
5
GOTO 3
p'
p
eb
t
Y
The point p is uniquely defined as the point in P that:
i) makes the largest angle at p spanned by the baseline eb , and
ii) p is visible from the endpoints of eb .
Q e ,L
c
(a)
ec
Q e ,R
c
(b)
(c)
(d)
Growing circles
Edge Insertion and Swapping
Recall:
|T | = 2|VI | + |VB | − 2
(I)
|E| = 3|VI | + 2|VB | − 3
(II)
|EI | = 3|VI | + |VB | − 3
(III)
(|T | = |E| − |V | + 1)
(IV )
That is, a new constraint edge between two existing nodes does
not change the cardinality of edges or triangles.
This may suggests that a new constrained edge can be “swapped
in place”!
Is this possible?
1
2
Swapping procedure for “inserting” a constraint ec into
∆(P, Ec ) (operating inside Rec only)?
LOP applied to edges inside each of Qec ,L and Qec ,R to
obtain ∆(P, Ec ∪ ec ).
Swapping procedure; proposal:
Swap edges away from the constrained edge ec such that
eventually ec is included as an edge in the triangulation.
Let (pa , u1 , . . . , un , pb ) define the closed influence polygon
Qec ,L to the left of the directed line from pa to pb .
Note how the vertices of the polygon are enumerated when it
is multiply connected; see the figure.
Consider a new point um each time where the angle αm < π and
swap away edges radiating from um and intersecting ec .
Questions:
1 is it always possible to find a point u
m where αm < π?
2
is there always a swappable edge at um ?
(a)
u1
u5
α4
α2
α3
u3
α6
α5
α1
pa
u6
Q ec , L
u2 u4
ec
pb
Q ec , R
u5
u1 u3
(b)
pa
u4
α3
α1
α2
u2
α5
α4
ec
pb
(c)
pa
u1
α1
ec
pb
Lemma (⋆)
A closed and simply connected polygon P has at least three
interior angles smaller than π.
Proof.
Let α1 , . . . , αN , N ≥ 3, be the interior angles of P and suppose
that k of them are smaller than π. From elementary geometry we
know that the sum of the interior angles is (N − 2)π and thus,
(N − 2)π =
N
X
αi =
i=1
We have
P
X
αi +
αi <π
X
αi .
αi ≥π
αi ≥ (N − k)π, which inserted above gives,
αi ≥π
(k − 2)π ≥
X
αi .
αi <π
The right hand side is non-negative, so we have k ≥ 2. But since
k > 0 the right hand side is in fact positive and this gives
k≥3
Aswer to question 1)
The lemma states that for a simply connected influence polygon
there is at least one vertex different from pa and pb where αm < π.
(Multiply connected polygon: see exercise.)
um
αm
w0 = um−1
wr +1 = um +1
ec
w1
w2
...
wr
Illustration for Lemma (⋆⋆).
Suppose that there are r edges radiating from um and
intersecting ec ; see figure.
The endpoints of the r edges on the opposite side of ec from
um are denoted w1 , . . . , wr , numbered counterclockwise.
Conventions: w0 = um−1 and wr+1 = um+1 .
Lemma (⋆⋆)
There is at least one edge radiating from um and intersecting ec ,
where αm < π, that is a diagonal in a convex quadrilateral (and
thus swappable).
Proof.
The closed polygon defined by the sequence (w0 , w1 , . . . , wr , wr+1 )
(not including um ) has at least three interior angles smaller than π
by Lemma(⋆). Thus, there is at least one point ws , 1 ≤ s ≤ r
such that the angle ∠ws−1 ws ws+1 is smaller than π. Then the
quadrilateral with (um , ws ) as a diagonal must be convex since
∠ws+1 , um , ws−1 is also smaller than π.
Thus, all edges (um , ws ), 1 ≤ s ≤ r, where αm < π, can be
swapped away from um such that there are no edges left
radiating from um and intersecting ec .
Result: um is eliminated from the influence polygon.
Algorithm (⋆, eliminate um , where αm < π)
1
while (r ≥ 1)
2
Let (um , ws ) be the diagonal in the convex quadrilateral
(um , ws−1 , ws , ws+1 ).
3
Swap (um , ws ) to (ws−1 , ws+1 )
4
r ←r−1
Eventually, r = 1 ...
um
αm
w0 = um−1
wr +1 = um +1
ec
w1
w2
...
wr
Eventually, r = 1 and and only one edge (um , w1 ) radiates from
um and intersects ec .
(um , w1 ) is a diagonal in the quadrilateral (um , um−1 , w1 , um+1 )
which is convex by Lemma (⋆⋆).
When (um , w1 ) is swapped to (um−1 , um+1 ) in the r’th cycle of
the algorithm, um is isolated from ec and eliminated from Q; see
u1 in next figure.
(a)
u1
u5
α4
α2
α3
u3
α6
α5
α1
pa
u6
Q ec , L
u2 u4
ec
pb
Q ec , R
u5
u1 u3
(b)
pa
u4
α3
α1
α2
u2
α5
α4
ec
pb
(c)
pa
u1
α1
ec
pb
Repeat Algorithm (⋆) on
Q \ um = (pa , u1 . . . , um−1 , um+1 , . . . un , pb )
etc. and eventually on Q = (pa , u1 , pb ).
Algorithm (Insert constrained edge ec )
1
while (n >= 1)
2
Find a point um , 1 ≤ m ≤ n where αm < π
3
Apply Algorithm (⋆) to um
4
n←n−1
5
Qec ,L ← (pa , u1 , . . . , um−1 , um+1 , . . . , un , pb )
When n = 1, Q = (pa , u1 , pb ) and the interior angle α1 at u1 is
smaller than π by Lemma; see figure.
When (u1 , w1 ) is swapped to (pa , pb ) it takes the role as the
constrained edge ec that has pa and pb as endpoints!
Finally, apply LOP to edges inside influence polygons Qec ,L and
Qec ,R .
LOP terminates as a CDT with ec as a constraint!
Existence follows from Lemma (⋆) extended to multiply connected
polygons, and Lemma (⋆⋆).
Inserting a point into a CDT
(a)
(b)
p
ec
ec
Influence polygon Qp in a)
Let ∆(P ∪ p, Ec ) be the CDT obtained by inserting a point p into
the CDT ∆(P, Ec ).
Lemma (Exact limitation of Rp )
A triangle t in ∆(P, Ec ) will be modified when inserting a point p
to obtain ∆(P ∪ p, Ec ) if and only if the circumcircle of t contains
p in its interior and p is visible from all the three nodes of t.
Proof.
The proof follows directly from: Theorem (Delaunay triangle).
How can ∆(P ∪ p, Ec) be obtained?
Alt. 1:
THEOREM. All new triangles of ∆(P ∪ p, Ec ) have p as a
common node.
Proof. See Exercise in lecture notes.
∆(P ∪ p, Ec ) can then be obtained from ∆(P, Ec ) by removing all
triangles of Rp and connecting p to all points of Qp ; see
Figure (b).
how can ∆(P ∪ p, Ec) be obtained ...
Alt 2, swapping procedure:
As for conventional Delaunay with this modification only:
recSwapDelaunay must not swap constrained edges:
Algorithm (recSwapDelaunay(Edge ei ))
1
if (ei ∈ Ec OR swapTest(ei) == OK)
2
RETURN
3
swapEdge(ei)
4
recSwapDelaunay(ei,1)
// recursion
5
recSwapDelaunay(ei,2)
// recursion
// til p
Download