Presentation is loading. Please wait.

Presentation is loading. Please wait.

Brute-Force Triangulation

Similar presentations


Presentation on theme: "Brute-Force Triangulation"— Presentation transcript:

1 Brute-Force Triangulation
1. Find a diagonal. 2. Triangulate the two resulting subpolygons recursively. How to find a diagonal? leftmost vertex case 2 case 1

2 Triangulating a Convex Polygon
Idea: monotone Decompose a simple polygon into convex pieces. Triangulate the pieces. as difficult as triangulation

3 y-monotone Pieces Stragegy: walk always downward or
highest vertex Stragegy: walk always downward or horizontal Partition the polygon into monotone pieces and then triangulate. lowest vertex

4 Turn Vertex Turn vertex is where the walk
from highest vertex to the lowest vertex switches direction.  Both adjacent edges are below. The polygon interior lies above. Choose a diagonal that goes up.

5 Five Types of Vertices 4 types of turn vertices
4 types of turn vertices Regular vetex: the remaining vertices (no turn). start vertices  end vertices split vertices  merge vertices

6 Local Non-Monotonicity
Proof split vertex interior exterior exterior interior merge vertex

7 Partitioning into Monotone Pieces
 Add a downward diagonal at every merge vertex.  Add an upward diagonal at every split vertex. Use a downward plane sweep. No new event point will be created except the vertices. The event queue is implemented as priority queue (e.g., heap).

8 Removal of a Split Vertex
edge helper

9 Removal of a Merge Vertex
Merge vertices can be handled the same way in an upward sweep as split vertices in a downward sweep. But why not all in the same downward sweep? Check if the old helper is a merge vertex and add the diagonal if so. (The diagonal is always added if the new helper is a split vertex).

10 Sweep-Line Status Implemented as a binary search tree.
Only edges to the left of the polygon interior are stored. This is because we are only interested in edges to the left of split and merge vertices. Edges are stored in the left-to-right order.

11 DCEL Representation Construct a doubly-connected edge list to represent the polygon. Add in diagonals computed for split and merge vertices. Edges in the status BST and corresponding ones in DCEL cross-point each other.

12 The Algorithm

13 Handling Start & End Vertices
v 5 v 3 e 5 v 4 e 4 v 6 e 3 e 6 v 1 v 14 e 2 v 7 v 2 v 9 v 8 e 7 e 1 e 8 e 15 e 14 e 9 v 12 v 15 v 10 e 10 e 11 e 13 e 12 v 11 v 13

14 Handling Split Vertex v v e v e v e e v e v v v v e e e e v e e v v v
v 5 v 3 e 5 v 4 e 4 v 6 e 3 e 6 v 1 e 2 v 7 v 2 v 9 v 8 e 7 e 1 e 8 e 15 v 14 e 14 e 9 v 12 v 15 v 10 e 10 e 11 e 13 e 12 v 11 v 13

15 Handling Merge Vertex (1)
v 5 v 3 e 5 v 4 e 4 v 6 e 3 e 6 v 1 e 2 v 7 v 2 v 9 v 8 e 7 e 1 e 8 e 15 v 14 e 14 e 9 v 12 v 15 v 10 e 10 e 11 e 13 e 12 v 11 v 13

16 Handling Merge Vertex (2)
i

17 Handling Regular Vertices (1)
v 5 v 3 e 5 v 4 e 4 v 6 e 3 e 6 v 1 e 2 v 7 v 2 v 9 v 8 e 7 e 1 e 8 e 15 v 14 e 14 e 9 v 12 v 15 v 10 e 10 e 11 e 13 e 12 v 11 v 13

18 Handling Regular Vertices (2)

19 Correctness Theorem The algorithm adds a set of non-intersecting
diagonals that partitions the polygon into monotone pieces. Proof The pieces that result from the partitioning contain no split or merge vertices. Hence they are monotone by an earlier lemma. We need only prove that the added segments are diagonals that intersect neither the polygon edges nor each other. Establish the above claim for the handling of each of the five type of vertices during the sweep. (Read the textbook on how to do this for the case of a split vertex.)

20 Running Time on Partitioning

21 It is for clarity of presentation and will be easily removed later.
It is for clarity of presentation and will be easily removed later. convex vertex lowest vertex on top. funnel Idea: add as many diagonals from the current vertex handled to those on the stack as possible. current vertex Invariants of iteration: reflex vertices One boundary of the funnel is a polygon edge. The other boundary is a chain of reflex vertices (with interior angles > ) plus one convex vertex (the highest) at bottom of the stack.

22 Case 1: Next Vertex on Opposite Chain
This vertex must be the lower endpoint of the single edge e bounding the chain. Pop these vertices from the stack. Add diagonals from the current vertex to them (except the bottom one) as they are popped. current vertex Push the previous top of the stack and the current vertex back onto the stack. j

23 Case 2: Next Vertex on the Same Chain
The vertices that can connect to the current vertex are all on the stack. Pop one vertex from the stack. It shares an edge with the current vertex. current vertex Pop other vertices from the stack as long as they are visible from the current vertex. Draw a diagonal between each of them and the current vertex. Pushed the last popped vertex back onto the stack followed by the current vertex.

24 The Triangulation Algorithm

25 An Example u u u u u Start: u u u u u u u u u u u u u u u u u u u u u
1 u 2 u 3 u 2 1 u 4 Start: u 6 u 5 u 7 u 8 u 9 u 10 u 11 u 4 u 3 u 3 u 12 u 2 u 2 u 13 u 14 u 1 u 1 u 15 u 16 u 18 u 17 u 4 u 19 u 2 u 5 u 5 u 6 u 20 u 1 u 5 u 1

26 Example (cont’d) u u u u u u u u u u u u u u u u u u u u u u u u u u u
1 u 2 u 3 u 4 u 7 u 6 u 6 u 5 u 6 u 5 u 7 u 8 u 9 u 10 u 11 u 8 u 7 u 9 u 12 u 7 u 6 u 8 u 13 u 14 u 15 u 16 u 18 u 17 u 11 u 10 u 10 u 9 u 19 u 20 u 10 u 8 u 8

27 Example (Cont’d) u u u u u u u u u u u u u u u u u u u u u u u u u u u
1 u 2 u 3 u 4 u 15 u 6 u 5 u 10 u 7 u 8 u 9 u 10 u 11 u 16 u 16 u 15 u 17 u 15 u 12 u 13 u 14 u 10 u 10 u 15 u 16 u 18 u 17 u 18 u 17 u 19 u 18 u 19 u 20 u 17 u 10 u 17

28 Removal of Strict y-monotonicity
#pops  #pushes Treat them from left to right. The effect of this is equivalent to that of rotating the plane slightly clockwise and then every vertex will have different y coordinate.

29 Time Complexity of Triangulation
1. Partition a simple polygon into monotone pieces. 2. Triangulate each monotone piece.

30 Triangulation of a Planar Subdivision
The algorithm for splitting a polygon into monotone pieces does not use the fact that the polygon was simple. The plane sweep for decomposition of a polygon into monotone pieces takes as input only edges that lie to the left of the interior. This easily generalizes to a planar subdivision in a bounding box.


Download ppt "Brute-Force Triangulation"

Similar presentations


Ads by Google