Tutorial 2 – Computational Geometry

Slides:



Advertisements
Similar presentations
Part II: Paper c: Skeletons, Roofs, and the Medial Axis Joseph ORourke Smith College.
Advertisements

Polygon Triangulation
Computational Geometry
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
Brute-Force Triangulation
Data Structure and Algorithms (BCS 1223) GRAPH. Introduction of Graph A graph G consists of two things: 1.A set V of elements called nodes(or points or.
UNC Chapel Hill M. C. Lin Polygon Triangulation Chapter 3 of the Textbook Driving Applications –Guarding an Art Gallery –3D Morphing.
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.
1 Voronoi Diagrams. 2 Voronoi Diagram Input: A set of points locations (sites) in the plane.Input: A set of points locations (sites) in the plane. Output:
The Divide-and-Conquer Strategy
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.
Overlay of Two Subdivisions
Chapter 12: Surface Area and Volume of Solids
CPCS 391 Computer Graphics 1 Lecture 5: Polygon Filling
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
Lecture 7: Voronoi Diagrams Presented by Allen Miu Computational Geometry September 27, 2001.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
Computational Geometry -- Voronoi Diagram
17. Computational Geometry Chapter 7 Voronoi Diagrams.
By Dor Lahav. Overview Straight Skeletons Convex Polygons Constrained Voronoi diagrams and Delauney triangulations.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
reconstruction process, RANSAC, primitive shapes, alpha-shapes
Fat Curves and Representation of Planar Figures L.M. Mestetskii Department of Information Technologies, Tver’ State University, Tver, Russia Computers.
Sorting and cell compositing for irregular meshes Nelson Max, Peter Williams, Richard Cook, Claudio Silva.
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Voronoi Diagrams.
Brute-Force Triangulation
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
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.
Algorithms for Enumerating All Spanning Trees of Undirected and Weighted Graphs Presented by R 李孟哲 R 陳翰霖 R 張仕明 Sanjiv Kapoor and.
Triangulating a monotone polygon
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
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.
Geometry: A Year Around By: Kourtney Mansfield. Chapter 1: Points, Lines, and Planes Point – Has no dimension. Usually represented by a small dot. Point.
1/29/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries Carola Wenk.
UNC Chapel Hill M. C. Lin Computing Voronoi Diagram For each site p i, compute the common inter- section of the half-planes h(p i, p j ) for i  j, using.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
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.
Computer Graphics CC416 Week 14 Filling Algorithms.
GEOMETRY!!!. Points  A point is an end of a line segment.  It is an exact location in space.   It is represented by a small dot. Point A A.
Polygon Triangulation
CMPS 3130/6130 Computational Geometry Spring 2017
Computational Geometry
Physical Structure of GDB
Introduction to Polygons
Plane and Space Curves Curvature-based Features
VORONOI DIAGRAMS FOR PARALLEL HALFLINES IN 3D
Query Processing in Databases Dr. M. Gavrilova
Algorithm design techniques Dr. M. Gavrilova
Grids Geometry Computational Geometry
Grids Geometry Computational Geometry
Craig Schroeder October 26, 2004
Grids Geometry Computational Geometry
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
I. The Problem of Molding
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
Computer Animation Algorithms and Techniques
Overlay of Two Subdivisions
In this chapter, you will learn the following:
Presentation transcript:

Tutorial 2 – Computational Geometry Polygonal Skeletons Tutorial 2 – Computational Geometry

The Skeleton of a Simple Polygon A polygon is a closed contour in the plane, which might contain holes (simple polygons as well). A skeleton of a polygon is a partition of the polygon into regions, creating internal vertices, edges and faces. We will deal with two main types of skeletons: The Medial Axis and the Straight skeleton.

The Medial Axis The Medial axis is defined as the locus of the centers of circles that are tangent to the polygon at two or more points.

The Medial Axis – Cont’d The Medial Axis comprises straight lines if the polygon is convex. If the object is concave, every reflex vertex induces a curved edge.

The Straight Skeleton The Straight Skeleton is a linear approximation of the Medial Axis. It is defined as the trace of the angular bisectors* of the vertices, as the edges of the polygon are propagating at equal rate, until the polygon vanishes. *Angular bisector – חוצה זווית

The Propagation of The Polygon As the edges of the polygon propagate at equal rate, the vertices move along the bisector of its two adjacent edges. Two possible events (assuming g.p.) may occur during the propagation: Edge Event – A portion (or the whole) of an edge vanishes. Split Event – A reflex vertex hits an opposite edge, splitting the polygon into two disconnected parts.

The Properties of The Straight Skeleton The faces of the straight skeleton are monotone (why?). Every internal skeleton node has degree 3* The Medial Axis and the straight skeleton of a convex polygon are identical. There are 2n-3 edges, n-2 inner vertices and n faces in a straight skeleton. * Degeneracy cases can be modeled to fit this rule using zero-length edges

Designing Rooftops When assigning a height field to an inner node - its offset distance from the edge - the skeleton can be interpreted as the rooftop of a house which walls are the sides of the original polygon.

Straight-Skeleton Computation Most algorithms take a straight-forward approach of event-based simulation of the propagation. The most time-efficient algorithm known has time complexity r = #reflex vertices, n = #vertices

Felkel & Obdrzálek 98’ Felkel & Obdrzálek offered a straightforward event-based algorithm. The algorithm computes and simulates the events by maintaining a set of circular Lists of Active Vertices called LAVs. The algorithm does not construct the intermediate offset polygons (although easily deduced), but only the skeleton itself.

The algorithm for Convex Polygons Initialization Create a LAV for the polygon – a circular list of its vertices by order. Add pointers for the edges between vertices. Compute a bisector per vertex. All vertices are marked “unused”. Calculation of initial edge events Compute the intersection point of every set of adjacent bisectors – this point is the location of the edge event between them. Queue the edge event (marked EDGE_EVENT) in a priority queue according to the distance of the intersection from the line supporting the edge.

Propagation Step While the events queue != empty do If next event uses used vertices, discard event. Else, handle edge event If LAV contains more than 3 edges Create two edges of the skeleton, each from one of the event vertices to the location of the event (the intersection point). Remove these two vertices from the LAV, and mark them as “used”. Create a new vertex, located at the intersection point, and put it in its place in the LAV, pointing to its adjacent edges. Compute new edge events for the vertices of these adjacent edges. Else, create new vertex at the intersection, and skeletal edges from each of the 3 vertices.

Propagation

Complexity The number of vertices reduces to zero, and the algorithm always stops. Complexity: O(nlogn), for maintaining the events queue. Every event handling is O(1).

The Algorithm for Nonconvex Polygons An extension of the convex algorithm. We have to find out when split events occur. Another step in initialization: Determine all possibilities of a reflex vertex hitting an opposite edge. Queue these events as SPLIT_EVENT

Obtaining Split Events A splitting location B is equidistant from the lines supporting the edges adjacent to the reflex vertex, and from the line supporting the opposite edge. For every reflex vertex, we traverse all of the edges in the polygon and test for intersection. A simple intersection test between the bisector of the reflex vertex and the opposite edge isn’t enough (why?).

Obtaining Split Events – Cont’d The intersection point between the reflex vertex and the line supporting the opposite edges must be in the area defined between the edge and the bisectors of its two vertices. The intersection point is the meeting point of the three bisectors between all three participating edges (the two defining the reflex vertex and the split edge).

Obtaining Split Events Not all reflex vertices eventually cause split events. (A is an edge event, and B is a split event).

Handling Split Events When a split event occurs, the polygon splits into two parts. The LAV in context is split into two LAVs as well.

Handling Split Events – Cont’d The splitting vertex is replaced with two new vertices, each in the appropriate place in a different LAV. New bisectors and edge events are calculated for each of these vertices (why only edge events?) The propagation continues…

Handling Multiple Splitting An edge can be split several time. Any split event handling must realize what part of the edge it is splitting (i.e. what are the proper endpoints). It is done by traversing the LAV in context at each handling of a split event.

Summary of the General Algorithm Initialization Create one LAV Compute bisectors Compute split and edge events Queue all events according to time (distance)

Summary – Cont’d Propagation In the end, there are no LAVs left! While event queue has events If new event contains used vertices, discard event. If event is edge event, handle as in the convex case. Mark vertices as “used”. If the LAV in context contains 3 vertices, close up the skeleton. If event is split event, split the LAV into two, and maintain pointers accordingly. Mark the splitting vertex as “used”. In the end, there are no LAVs left!

A Simple Polygon with Holes The approach is similar. Any hole is a different LAV in the initialization. Two LAVs can merge when a split event occurs between two different boundaries – correct LAV pointer treatment should be applied.

The Complexity of the Algorithm Initializing and handling each split event require traversing all of the edges per each reflex vertex. So, the total complexity is O(rn+nlogn) r = # reflex vertices If r=o(n) then the algorithm is quadratic – a reachable upper bound. Most practical cases behave better. Space complexity is O(n).

3D Straight skeletons – A (New) View The faces of a polyhedron propagate at equal rate. Skeleton is the trace of faces, edges and vertices.

Bibliography Source of images (and recommended reading): “Medial Axis presentation” - http://groups.csail.mit.edu/graphics/classes/6.838/F01/lectures/MedialAxisEtc/presentation/ “Single-Fold Disk Hiding” - http://jeff.cs.mcgill.ca/~mcleish/507/single.html “Straight skeleton of a simple polygon” - http://compgeom.cs.uiuc.edu/~jeffe/open/skeleton.html “Raising roofs, crashing cycles, and playing pool” - http://compgeom.cs.uiuc.edu/~jeffe/pubs/cycles.html “Designing Roofs of Buildings “ - http://www.sable.mcgill.ca/~dbelan2/roofs/roofs.html Straight Skeleton Computation P. Felkel and S. Obdrzalek, Straight skeleton computation, Spring Conf. on Computer Graphics, Budmerice, Slovakia, 210--218, 1998.