1 / 9

Graham Scan Triangulation

Graham Scan Triangulation. Reference. Summary. Time complexity: O(kn), k-1 is the number of concave vertices in the polygon Worst case: O(n 2 ), yet easy to implement Algorithm: Loop around polygon to cut ear Once an ear is cut, update the list of concave vertices An ear can be cut if:

Download Presentation

Graham Scan Triangulation

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. Graham Scan Triangulation Reference

  2. Summary • Time complexity: O(kn), k-1 is the number of concave vertices in the polygon • Worst case: O(n2), yet easy to implement • Algorithm: • Loop around polygon to cut ear • Once an ear is cut, update the list of concave vertices • An ear can be cut if: • Ear is at a convex vertex • Triangle does not contain any concave vertex

  3. Algorithm Build diagonal; cut ear Check concavity of two sides of the ear; update R if necessary P: vertices in the polygon R: concave vertices in P

  4. P={0,1,2,3,4,5} R={3,4} 2 i=2 IsAnEar(P,R,1) = F {3 in ∆012} i=3 1 3 4 5 0

  5. P={0,1,2,3,4,5} R={3,4} 2 i=3 IsAnEar(P,R,2) = T Diagonal(1, 3) P -= {2} Check concavity of 3 and 1: R -= {3} 1 3 4 5 0

  6. P={0,1,3,4,5} R={4} 2 i = 3 IsAnEar(P,R,1) = T {1 is convex  4 not in ∆013} Diagonal(0, 3) P -= {1} Check concavity of 3 and 0: {no-op} PRED(3) = 0 i=SUCC(3)=4 1 3 4 5 0 Never cut the ear at p0

  7. P={0,3,4,5} R={4} 2 i = 4 IsAnEar(P,R,3) = T {3 is convex  4 not in ∆034} Diagonal(0, 4) P -= {3} Check concavity of 4 and 0: R -= {4} PRED(4) = 0 i=SUCC(4)=5 1 3 4 5 0

  8. P={0,4,5} R={ } 2 i = 5 P is a triangle = T i=SUCC(5) = 0 1 3 4 5 0

  9. P={0,4,5} R={ } 2 i = 0 END Triangulate 1 3 4 5 0

More Related