Title: Constraining Delaunay Triangulation
1Constraining Delaunay Triangulation
2Summary
- There are 2 stages to constraining the
triangulation - Collect a list of boundary edges
- For each of these boundary edges
- Collect a queue of Crossing Edges
- Obtain the first crossing edge
- Obtain the subsequent crossing edges given a
recently found crossing edge - For each of the crossing edges
- Perform a swap
- Check whether the swap is valid
- If so, remove the crossing edge from the queue
- If not, undo the swap and place the crossing edge
to the end of the queue - If it is a valid swap, Check if the swap
intersect the boundary edge - If so, place the swapped edge to the end of the
queue of crossing edges - Once the queue is empty, the resulting
triangulation is constrainied.
3Step 1 Obtaining the boundary edges
- Obtain all list of boundary edges that the
triangulation should conform to.
4Step 2.1 Obtaining the Crossing Edges
- For each of the boundary edges obtained in Step 1
- Check if the edge are part of the triangle.
- A way of implementing this step is the following
- The boundary edge consist of point n0, and n1.
- Collect a list of triangles that is associated
with point n0. For every of these triangles,
check if point n1 is part of the triangle. If so,
then the boundary edge is part of the
triangulation. - If not, obtain a queue of crossing edges
- Obtain the first crossing edge
- Obtain the subsequent crossing edge given a
recently found crossing edge
5Step 2.1.1 Obtaining the first Crossing Edge
- Definitions
- n0, n1 defines the boundary edge ( blue line )
and the black triangles are part of the
triangulation.
6Step 2.1.1 Obtaining the first Crossing Edge
- In order to obtain the first crossing edge
- Discover the triangle at n0 that has the crossing
edge. - ltn0, a, bgt means that n0, a, b are points of the
triangle in a counter-clockwise order.
7Step 2.1.1 Obtaining the first Crossing Edge
- Definitions
- Obtain the normal of n0-b and a-n0 which is 90
degree counter-clockwise (Simply multiply the
vector by to obtain its desired
normal) - The red vectors represents the desired normal
vectors
n0-b
b
n1-n0
n0
n1
n0
n1
a
a-n0
8Step 2.1.1 Obtaining the first Crossing Edge
- Discover the triangle at n0 that has the crossing
edge. - We know we have the correct triangle if the dot
product of n1-n0 with the two recently computed
normal vectors gt 0 - The offending edge in our case is lta,bgt -gt put
into a queue of crossing edges
n0-b
b
n1-n0
n0
n1
n0
n1
a
a-n0
9Step 2.1.1 Obtaining the first Crossing Edge
- There are only three variants of the triangle
intersecting the boundary edge with n0 as one of
the point - The given criterion to find the first crossing
edge is sufficient to cater for these cases.
n0
n0
10Step 2.1.2 Obtaining Subsequent Crossing Edges
- Once a crossing edge is obtained, obtain the
unexplored adjacent triangle to the crossing edge
(green) we have just obtained.
Unexplored Adjacent triangle to the crossing edge
Explored Adjacent triangle
n0
n1
n0
n1
11Step 2.1.2 Obtaining Subsequent Crossing Edges
- The procedure to obtain another crossing edge is
as follows - The unexplored adjacent triangle can be defined
as lta,b,cgt in a counter-clockwise order. - Compute the normal of c n0 that is 90 degree
Counter-clockwise - If the dot product of the normal of c n0 and
n1-n0 is - Positive gt lta,cgt is the offending edge -gt put
into a queue - Negative gt ltb,cgt is the offending edge -gt put
into a queue
a
c
a
n1-n0
n0
n1
n0
n1
n1-n0
c
b
b
12Step 2.1.2 Obtaining Subsequent Crossing Edges
- We continue to find all crossing edges by using
the procedure described to transverse from n0 to
n1 - Stop once if the triangle you are exploring has
n1 as one of the point.
n0
n1
13Step 2.2.1 Performing the swap
- At this stage, we will have list of all crossing
edges given a boundary edge. - For every crossing edge, get the 2 adjacent
triangles to it. - Perform a swap depicted below
Perform a swap
14Step 2.2.2 Validity of Swap
- However performing a swap in the below scenario
is not feasible.
Perform a swap
15Step 2.2.2 Validity of Swap
- Hence we need to test for a valid swap
- Before Swapping, Triangle 1 (n0, n1, n2),
Triangle 2 by (n0, n3, n1) - Defined in a Counter-clockwise order
- Define diag n2-n3, e1 n1-n3, e2 n0 n3
- The Swap is valid if determinant e1 diag gt 0
diag e2 gt 0 - Another way of looking at the determinant is
obtaining the z-component of e1 x diag and diag x
e2
n3
diag
e1
n2
n0
e2
n1
16Step 2.2.2 Validity of Swap
- If the swap is valid, remove the crossing edge
from the queue - If the swap is not valid, undo the swap and place
the crossing edge to the end of the queue
17Step 2.2.3 Test whether Swapped Edge intersect
Boundary
- If the swap is valid, we have to check if the
swapped edge conformed to the boundary edge ltn0,
n1gt - If the swapped edge contain no or n1 as one of
its points, swapped edge doesnt intersect with
the specified boundary edge. - Check if the points of the swapped edge is on the
same side - If not, the swapped edge intersect the boundary
edge, place it in the end of the queue and
process the rest of the crossing edge - If yes, the swapped edge doesnt intersect the
boundary edge, continue to process the rest of
the crossing edge.
18Step 2.2.3 Test whether Swapped Edge intersect
Boundary
- In order to check if the points of the swapped
edge lts0,s1gt are on the same side of the boundary
edge - Define vec1 s0-n0, vec2 s1-n0, b_edge n1
n0 - Compute cross1 detb_edge vec1, cross2
detb_edge vec2 - If cross1 and cross2 are of the same sign, then
they are of the same side. If not, then they are
of the different side
Cross1 lt 0 Cross2 lt 0
b_edge
vec1
vec2
s0
Cross1 gt 0 Cross2 lt 0
s1
19Step 3 Completion of Constraining Delaunay
Triangulation
- Once the queue is empty, the constraining of
triangulation is completed.
20Side Notes
- Apply the constraining of the triangulation
before removing the bounding box (Bowyer-Watson
Triangulation) - To remove the exterior triangles (outside of the
boundary), delete all triangles associated with
the bounding box nodes