1 / 32

Triangulation Supplemental

Triangulation Supplemental. From O’Rourke (Chs. 1&2) Fall 2005. Contents. Ear clipping algorithm Triangulating monotonic polygons Monotonic decomposition via trapezoidalization. Ear Clipping. Go around the polygon to check whether a diagonal can be drawn from (i-1) to (i+1)

samira
Télécharger la présentation

Triangulation Supplemental

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005

  2. Contents • Ear clipping algorithm • Triangulating monotonic polygons • Monotonic decomposition via trapezoidalization

  3. Ear Clipping • Go around the polygon to check whether a diagonal can be drawn from (i-1) to (i+1) • Diagonal check: • No edge crossing AND inside P What is the time complexity in the worst case?

  4. 5 3 7 4 6 1 0 2

  5. Think… • Can every simple polygon be triangulated? • Does every simple polygon have at two ears (so that ear clipping algorithm can work)?

  6. No edge crossing Each potential diagonal (i-1, i+1) need to check with ? edges “In-Cone” check: local geometry Validity of Diagonal

  7. Triangulating Monotonic Polygons Why? • Linear time algorithm: O(n) • Fact on monotonic polygons • Def: a vertex is called reflex if its internal angle is strictly greater than p • Def: cusp • A reflex vertex whose adjacent vertices v- and v+ are either both above or below v. • Lemma: • If a polygon P has no cusps, then it is monotone.

  8. Algorithm Ideas: • Cut off triangles from the top in a greedy fashion • At each step, the first available triangle removed • For each vertex v, connect v to all the vertices above it and visible via a diagonal, and remove the top portion of the polygon thereby triangulated • Continue with the next vertex below v

  9. Case 1: Case 2a, 2b:

  10. 1 2 3 4 5 6 7 8 Triangulate Monotone Polygon Sort by y-coordinate reflex chain: {1,2} v = 3

  11. 1 2 3 4 5 6 7 8 v = 3 chain: {1,2} [same side, non-convex] Case 2b: chain {1,2,3} v = 4

  12. 1 2 3 4 5 6 7 8 v = 4 chain: {1,2,3} [same side, non-convex] Case 2b: chain {1,2,3,4} v = 5

  13. 1 2 3 4 5 6 7 8 v = 5 chain: {1,2,3,4} [opposite side] Case 1: diagonal (5,2) reflex chain {1,2,3,4}

  14. 1 2 3 4 5 6 7 8 v = 5 chain: {2,3,4} [opposite side] Case 1: diagonal (5,3) reflex chain {2,3,4}

  15. 1 2 3 4 5 6 7 8 v = 5 chain: {3,4} [opposite side] Case 1: diagonal (5,4) reflex chain {3,4} reflex chain {4,5} v = 6

  16. 1 2 3 4 5 6 7 8 v = 6 chain: {4,5} [same side, non-convex] Case 2b: reflex chain {4,5,6} v = 7

  17. 1 2 3 4 5 6 7 8 v = 7 chain: {4,5,6} [same side, convex] Case 2a: diagonal (7,5) reflex chain {4,5,6}

  18. 1 2 3 4 5 6 7 8 v = 7 chain: {4,5} [same side, convex] Case 2a: diagonal (7,4) reflex chain {4,5} reflex chain {4,7} v = 8

  19. 1 2 3 4 5 6 7 8 v = 8 chain: {4,7} [lowest vertex; stop]

  20. 0 1 2 3 4 {4,5} {4,6} 5 6 7 {6,7} 8 {7,8} 9 {7,9} 10 {9,10} 11 12 13 {0,1,2} {0,1,2,3} {0,1,2,3,4} {0,1,2,3,4} {4,5} {4,6} {6,7} {7,8} {7,9}

  21. Trapezoidalization • Accomplish monotonic subdivision via horizontal trapezoidalization • Supporting vertices: the vertices through which the horizontal lines are drawn • Assume P be a polygon with no two vertices on a horizontal line • Each trapezoid has exactly two supporting vertices: one on top, one on bottom • Remove cusps by connecting the supporting vertex to the opposite vertex Assume no two points have same y coord.

  22. The support line stops at the boundary

  23. Trapezoidalization via Plane Sweep • Time complexity: O(n log n) • Maintain a balanced tree of edges

  24. Sweep Line Events (…, a, c, b, …) (…, a, d, b, …) (…, a, c, d, b, …) (…, a, b, …) (…, a, b, …) (…, a, c, d, b, …)

  25. Summary

  26. Review Questions • Analyze the worst case complexity of ear clipping algorithm • Analyze the time complexity of the algorithm for triangulating monotone polygon • Triangulate (and keep track of the reflex chain) of the polygon on the next page • Decompose the polygon on page 24 into monotonic pieces using trapezoidalization

  27. Monotone-ization • If the polygon has no cusp, it is monotone and can be triangulated immediately. • [seek an orientation where the polygon is monotone] • Decompose into monotone pieces via horizontal trapezoidalization

  28. Three Types of Event Points Regular (…, a, c, b, …) replace (…, a, d, b, …) Upward cusp remove (…, a, c, d, b, …) (…, a, b, …) Downward cusp insert (…, a, b, …) (…, a, c, d, b, …)

  29. Making Trapezoids • Regular point: Extend toward material side until a boundary is reached • Cusps: extend both sides until boundaries are reached

  30. {aj} j {ajih} h {ajicdh}u.cusp a i {ajicdg} {acdg}d.cusp {acdefg}u.cusp d g {bcdefg} f e {bcde} c {bc} b {} Upward cusp: connect to support vertex above Downward cusp: connect to support vertex below [implementation]

More Related