Polygon Triangulation

Slides:



Advertisements
Similar presentations
Polygon Triangulation
Advertisements

Planar Orientations Chapter 4 ( ) in the book Written By: Tomer Heber.
Convex drawing chapter 5 Ingeborg Groeneweg. Summery What is convex drawing What is convex drawing Some definitions Some definitions Testing convexity.
Brute-Force Triangulation
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
One of the most important problems is Computational Geometry is to find an efficient way to decide, given a subdivision of E n and a point P, in which.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Triangulation (Naive)
POLYGON TRIANGULATION POLYGON TRIANGULATION THE ART GALERY PROBLEM SİNEM GETİR COMPUTER GRAPHIC SEMINAR FEBRUARY 4, 2009.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
I. The Problem of Molding Does a given object have a mold from which it can be removed? object not removable mold 1 object removable Assumptions The object.
By Groysman Maxim. Let S be a set of sites in the plane. Each point in the plane is influenced by each point of S. We would like to decompose the plane.
Feb Polygon Triangulation Shmuel Wimer Bar Ilan Univ., School of Engineering.
G UARDING A RT G ALLERY By: Venkatsai Bhimanthini Fall’2014.
Applied Combinatorics, 4th Ed. Alan Tucker
Intersections. Intersection Problem 3 Intersection Detection: Given two geometric objects, do they intersect? Intersection detection (test) is frequently.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 2 Polygon Partitioning Thursday,
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann 1 Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
Lecture 3: Polygon Triangulation Computational Geometry Prof. Dr. Th. Ottmann Polygon Triangulation Motivation: Guarding art galleries Art gallery theorem.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
Polygon Triangulation Computational Geometry, WS 2007/08 Lecture 9 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
Chapter 4: Straight Line Drawing Ronald Kieft. Contents Introduction Algorithm 1: Shift Method Algorithm 2: Realizer Method Other parts of chapter 4 Questions?
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 2 Chapter 2: Polygon Partitioning.
Polygon Triangulation Computational Geometry, WS 2006/07 Lecture 8, Part 2 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Art Gallery Theorem Computational Geometry, WS 2006/07 Lecture 8, Part 1 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
Curve Curve: The image of a continous map from [0,1] to R 2. Polygonal curve: A curve composed of finitely many line segments. Polygonal u,v-curve: A polygonal.
The Art Gallery Problem
Brute-Force Triangulation
Computational Geometry Piyush Kumar (Lecture 4: Planar Graphs, Polygons and Art Gallery) Welcome to CIS5930.
The Art Gallery Problem
9/7/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries Carola Wenk.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
Triangulating a monotone polygon
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
CENG 789 – Digital Geometry Processing 02- Polygons and Triangulations Asst. Prof. Yusuf Sahillioğlu Computer Eng. Dept,, Turkey.
1 Triangulation Supplemental From O’Rourke (Chs. 1&2) Fall 2005.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
The Art Gallery Problem Bart Verzijlenberg. Agenda Problem Problem Chvátal’s Classical Art Gallery Theorem Chvátal’s Classical Art Gallery Theorem Proof.
Contest Algorithms January 2016 Triangulation & the Art Gallery Problem Contest Algorithms1.
February 17, 2005Lecture 6: Point Location Point Location (most slides by Sergi Elizalde and David Pritchard)
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 9 Line Arrangements.
COMPSCI 102 Introduction to Discrete Mathematics.
Polygon Triangulation
Breadth-First Search (BFS)
CMPS 3130/6130 Computational Geometry Spring 2017
3. Polygon Triangulation
Outline 1 Properties of Planar Graphs 5/4/2018.
Computational Geometry
Introduction to Spatial Computing CSE 555
Computer Graphics Filling.
CENG 789 – Digital Geometry Processing 02- Polygons and Triangulations
Advanced Algorithms Analysis and Design
Fill Area Algorithms Jan
Query Processing in Databases Dr. M. Gavrilova
Tucker, Applied Combinatorics, Sec 2.4
Planarity Testing.
The Art Gallery Problem
Computational Geometry Capter:1-2.1
The Art Gallery Problem
Convex Sets & Concave Sets
I. The Problem of Molding
Triangulation of a polygon
Computational Geometry
Discrete Mathematics for Computer Science
Presentation transcript:

Polygon Triangulation (slides partially by Daniel Vlasic )

Triangulation: Definition Triangulation of a simple polygon P: decomposition of P into triangles by a maximal set of non-intersecting diagonals Diagonal: an open line segment that connects two vertices of P and lies in the interior of P Triangulations are usually not unique

Motivation: Guarding an Art Gallery An art gallery has several rooms Each room guarded by cameras that see in all directions Want to have few cameras that cover the whole gallery

Triangulation: Existence Theorem: Every simple polygon admits a triangulation Any triangulation of a simple polygon with n vertices consists of exactly n-2 triangles Proof: Base case: n=3 1 triangle (=n-2) trivially correct Inductive step: assume theorem holds for all m<n

Inductive step First, prove existence of a diagonal: Let v be the leftmost vertex of P Let u and w be the two neighboring vertices of v If open segment uw lies inside P, then uw is a diagonal

Inductive step ctd. If open segment uw does not lie inside P there are one or more vertices inside triangle uvw of those vertices, let v' be the farthest one from uw segment vv' cannot intersect any edge of P, so vv' is a diagonal Thus, a diagonal exists Can recurse on both sides Math works out: (n1-2) + (n2-2) = (n1+n2-2)-2

Back to cameras Where should we put the cameras ? Idea: cover every triangle 3-color the nodes (for each edge, endpoints have different colors) Each triangle has vertices with all 3 colors Can choose the least frequent color class → n/3 cameras suffice There are polygons that require n/3 cameras

3-coloring Always Possible Take the dual graph G This graph has no cycles Find 3-coloring by DFS traversal of G: Start from any triangle and 3-color its vertices When reaching new triangle we cross an already colored diagonal Choose the third color to finish the triangle

How to triangulate fast Partition the polygon into y-monotone parts, i.e., into polygons P such that an intersection of any horizontal line L with P is connected Triangulate the monotone parts

Monotone partitioning Line sweep (top down) Vertices where the direction changes downward<>upward are called turn vertices To have y-monotone pieces, we need to get rid of turn vertices: when we encounter a turn vertex, it might be necessary to introduce a diagonal and split the polygon into pieces

Vertex Ontology

Adding diagonals To partition P into y-monotone pieces, get rid of split and merge vertices add a diagonal going upward from each split vertex add a diagonal going downward from each merge vertex Where do the edges go ?

Helpers Let helper(ej) be the lowest vertex above the sweep-line such that the horizontal segment connecting the vertex to ej lies inside P

Proof Recall: The segment h-vi is a diagonal because: vi is the split vertex ej is the edge to the left of vi h = helper(ej) The segment h-vi is a diagonal because: The dotted segments do not intersect any polygon boundaries, by def. Same holds for ej. If there was any polygon segment intersecting h-vi, one of its endpoint would have to be inside the yellow 4-gon h ej vi

Removing Split Vertices For a split vertex vi, let ej be the edge immediately to the left of it Add a diagonal from vi to helper(ej)

Removing Merge Vertices For a merge vertex vi, let ej be the edge immediately to the left of it vi becomes helper(ej) once we reach it Whenever the helper(ej) is replaced by some vertex vm, add a diagonal from vm to vi If vi is never replaced as helper(ej) , we can connect it to the lower endpoint of ej

The algorithm Use plane sweep method Time: O(n log n) move sweep line downward over the plane (need to sort first) halt the line on every vertex handle the event depending on the vertex type events: edge starts (insert into a BST) edge ends (add a diagonal if the helper is a merge vertex, remove from BST) edge changes a helper (add a diagonal if old helper was a merge vertex) new vertex is a split vertex (must add a diagonal) Time: O(n log n)

Triangulating monotone polygon

Altogether Can triangulate a polygon in O(n log n) time Fairly simple O(n log*n) time algorithms Very complex O(n) time algorithm