1 / 67

AMS 345/CSE 355 Computational Geometry

This article explores different algorithms for triangulating simple polygons, including methods for polygons with holes. It also discusses the concepts of visibility, diagonals, and the planar dual graph. The article concludes with a review of various algorithms and their time complexities.

ajordan
Download Presentation

AMS 345/CSE 355 Computational Geometry

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. AMS 345/CSE 355 Computational Geometry Joe Mitchell Triangulation Algorithms Some figures: [O’Rourke]: Computational Geometry in C: Chap 2

  2. Triangulation Simple polygon Planar Straight-Line Graph (PSLG) Polygon with holes Input: Set S of n points Input: Other shapes 3D: Surfaces and solids (tetrahedralization) Triangulation applet for simple polygons

  3. Simple Polygons Definition: A simple polygon P is the (closed) region bounded by a “simple closed polygonal curve”.

  4. Simple Polygon Definition in [O’Rourke]:

  5. Simple Polygons Alternate Definition: P is a simple polygon if it is a simply connected (i.e., no “holes”) subset of the plane whose boundary consists of a connected finite union of straight line segments.

  6. Simple Polygons Some definitions would allow this as a “degenerate” simple polygon

  7. Definitions: Visibility, Diagonals p q For p,q in P, p is visible to q if segment pq lies within (closed) P

  8. Definitions: Visibility, Diagonals p clearly sees q but does not clearly see q’ p sees q’ p q q’ For p,q in P, p is visible to q if segment pq lies within (closed) P p is clearly visible to q if p is visible to q AND the only points in common between pq and P are possibly p and q

  9. Definitions: Visibility, Diagonals q vm vj p vi pq is a chord (not a diagonal) vivj is a diagonal vkvm is not a diagonal vk vivj is a diagonal if vi and vj are vertices that clearly see each other (versus: chordpq, with p and q on the boundary of P)

  10. Diagonals [Devadoss-O’Rourke]

  11. Triangulation Definition: A partition of P into triangles by a set of noncrossing diagonals. (= a partition of P by a maximal set of noncrossing diagonals) [Devadoss-O’Rourke]

  12. Triangulation Theory in 2D Also with holes But, NOT true in 3D! Proofs: Induction on n. • Thm: A simple polygon has a triangulation. • Lem: An n-gon with n4 has a diagonal. • Thm: Any triangulation of a simple n-gon has n-3 diagonals, n-2 triangles. • Thm: The “dual” graph is a tree. • Thm: An n-gon with n4 has 2 “ears”. • Thm: The triangulation graph can be 3-colored.

  13. Ears vi+1 vi-1 A diagonal of the form vi-1vi+1 is an ear diagonal; the triangle vi-1vivi+1 is an ear, and vi is the ear tip Note that there are at most n ears (and that a convex polygon has exactly n ears) vi

  14. Ears [Devadoss-O’Rourke] Proof(1): There are n edges of P and n-2 triangles in any triangulation. Imagine dropping the n edges into the n-2 “pigeonholes” corresponding to the triangles: Each edge appears on boundary of some triangle. By pigeonhole principle, at least 2 triangles get 2 edges “dropped in their box”. (2) Consider the planar dual (excluding the face at infinity) of a triangulation of P. Claim: The dual graph for a triangulated simple polygon is a TREE. Any tree of 2 or more nodes has at least 2 nodes of degree 1.

  15. Triangulating a Simple Polygon fan Not practical! • Simple “ear-clipping” methods: O(n2 ) • Cases with simple O(n) algorithms: • Convex polygons (trivial!) • Monotone polygons, monotone mountains • General case (even with holes!): • Sweep algorithm to decompose into monotone mountains • O(n log n) • Best theoretical results: • Simple polygons: O(n) [Chazelle’90] • Polygons with h holes: O(n+h log1+ h), (n+h log h) [BC] • Good practical method: FIST [Held], based on clever methods of ear clipping (worst-case O(n2 ) )

  16. Lower Bound (n+h log h) (n) : Have to read the data (h log h) : from SORTING

  17. FIST: Fast Industrial-Strength Triangulation Based on ear clipping Constrained Delaunay Simple polygon FIST Works nicely also for highly degenerate and “crazy” polygons 3D cycles http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html

  18. Ear-Clipping Triangulation Ear-clipping applet Input: Simple polygon P vi+1 vi-1 vi pq is a diagonal, cutting off a single triangle (the “ear”) Naive: O(n3) Smarter: Keep track of “ear tip status” of each vi (initialize: O(n2) ) Each ear clip requires O(1) ear tip tests ( @ O(n) per test ) Thus, O(n2) total, worst-case

  19. Triangulate

  20. Ear-Clipping Lemma: When clipping ear wth tip vithe only ear tip statuses that can change are at vi-1and vi+1

  21. Example: Triangulate

  22. Example: Output

  23. W(n2 ) Examples Exist

  24. Today, 9/26/13 Review: O(n log n) triangulation Examples Primitives: Left test, etc Time permitting: Convex decompositions, Hertel-Mehlhorn

  25. Faster Algorithm: O(n log n) Input: PSLG of size n; enclosed by a big box B Step 1: Use sweep to decompose B into “y-monotone mountains” – y-monotone polygons having one side (left/right) a single segment (the “base”); O(n log n) Step 2: Triangulate each y-monotone polygon (size ni) in time O(ni), for total O(n) Overall: O(n log n) to triangulate PSLG

  26. Monotone Polygons t d Every line perpendicular to d intersects P in a connected set; i.e., the left/right chains from bottom, b, to top, t, are each d-monotone. b P is monotone in direction d

  27. Monotone Polygons d P is monotone in direction d

  28. y-Monotone Polygon d

  29. Examples Which of these polygons are monotone? (with respect to which directions d?) Which are monotone mountains? With respect to which directions d?

  30. Examples Circle of directions of monotonicity, d

  31. Example from Practice Midterm

  32. y-Monotone Polygon d

  33. Monotone Mountains t d b

  34. Triangulating a Monotone Mountain in O(n) t vi-1 vi vi+1 vi is ear tip iff Left(vi+1 , vi , vi-1 ) Just traverse vertices from top to bottom. Test/clip ears. If an ear is clipped, re-test the earity of the upper endpoint (vi-1 ) of the diagonal just clipped. monotone • Ear clipping is easy! • Testing if vi-1 vi+1 is a diagonal takes only O(1) time b

  35. Triangulating a Monotone Mountain in O(n)

  36. Example

  37. Triangulation in O(n log n) L Fire bullets left/right from each vertex SLS: left-to-right ordering of segments crossed by L (balanced binary tree) Events: L hits a vertex (1) Plane sweep to get horizontal trapezoidalization Time: O(n log n)

  38. Sweep Algorithms Paradigm: Process geometric data by “sweeping” over it, in some order

  39. Sweep Algorithms • Two key ingredients of any sweep algorithm: • (1) The “Sweep Line Status” (SLS): gives a “combinatorial description” of the “slice” given by the sweeping line • Often stored in a balanced binary tree • (2) Events: These are instants when the SLS “changes” combinatorially, and we must pause and do some event handling. Store in “Event Queue” (EQ), often a “priority queue” that allows us to quickly determine the next event • Often events occur at certain discrete points/vertices of the input; EQ is sometimes “static” (events known in advance), sometimes “dynamic” (events learned as we go)

  40. Sweep Algorithms • What is needed to describe a sweep algorithm: • What is being “swept”? (line, plane, curve, etc) And how is it “sweeping”? (“order”?) • What exactly does the SLS store, and in what kind of data structure is it stored (to provide for efficient updates as it changes)? • Exactly what are the “events”? How are they stored (the Event Queue, EQ)? How are they handled? Usually there are various cases, and one must specify for each exactly what updates are made to the SLS and the EQ (if any).

  41. Trapezoidalization

  42. Trapezoidalization

  43. Trapezoidalization In each case: We do O(1) updates to the SLS, each taking time O(log n), since the SLS is stored in a balanced binary search tree.

  44. Trapezoidalization

  45. Triangulation in O(n log n) Lemma: Resulting pieces are monotone mountains (2) Join top vertex to bottom vertex in each trapezoid

  46. Triangulation in O(n log n) Triangulate each, in time O(ni ), for total time O(n) Summary: O(n log n) to triangulate n points or a planar straight-line graph (PSLG) (3) Triangulate each monotone mountain

  47. Bottom Line: Triangulation in 2D • Best theoretical results: • Simple polygons: O(n) [Chazelle’90] • Polygons with h holes: O(n+h log1+ h), (n+h log h) [BC] • PSLG: for each simple face (without holes), O(ni); for each face with holes, O(ni+hilog1+ hi) • Good practical method: FIST [Held], based on clever methods of ear clipping (worst-case O(n2 ))

More Related