UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Chapter 4: 3D Convex Hulls Friday, 2/9/07.

Slides:



Advertisements
Similar presentations
Geometry Introduction
Advertisements

Map Overlay Algorithm. Birch forest Wolves Map 1: Vegetation Map 2: Animals.
2/14/13CMPS 3120 Computational Geometry1 CMPS 3120: Computational Geometry Spring 2013 Planar Subdivisions and Point Location Carola Wenk Based on: Computational.
Convex hulls Gift wrapping, d > 2 Problem definition CONVEX HULL, D > 2 INSTANCE. Set S = { p 1, p 2, … p N } of points in d-space (E d ). QUESTION. Construct.
Brute-Force Triangulation
C o m p u t i n g C O N V E X H U L L S by Kok Lim Low 10 Nov 1998 COMP Presentation.
Convex Hulls in Two Dimensions Definitions Basic algorithms Gift Wrapping (algorithm of Jarvis ) Graham scan Divide and conquer Convex Hull for line intersections.
Ruslana Mys Delaunay Triangulation Delaunay Triangulation (DT)  Introduction  Delaunay-Voronoi based method  Algorithms to compute the convex hull 
Introduction to Algorithms Rabie A. Ramadan rabieramadan.org 6 Ack : Carola Wenk nad Dr. Thomas Ottmann tutorials.
Convex Hulls May Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
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.
Convex Hulls in 3-space Jason C. Yang.
1 Convex Hull in Two Dimensions Jyun-Ming Chen Refs: deBerg et al. (Chap. 1) O’Rourke (Chap. 3)
Computational Geometry
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 Lecture 2 Polygon Partitioning Thursday,
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 O’Rourke Chapter 7 Search & Intersection.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 4 Chapter 6: Arrangements Monday,
UMass Lowell Computer Science Graduate Algorithms Prof. Karen Daniels Spring, 2005 Computational Geometry Overview from Cormen, et al. Chapter 33.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Chapter 5: Voronoi Diagrams Wednesday,
Duality and Arrangements Computational Geometry, WS 2007/08 Lecture 6 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 5: Voronoi Diagrams Monday, 2/23/04.
Polygonal Mesh – Data Structure and Smoothing
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Lecture 2 Chapter 2: Polygon Partitioning.
Computational Geometry Overview from Cormen, et al. Chapter 33
Geometric Modeling Mortenson Chapter 1 (including some material from Farin Ch. 2)
Lecture 8 : Arrangements and Duality Computational Geometry Prof. Dr. Th. Ottmann 1 Duality and Arrangements Duality between lines and points Computing.
Point Location Computational Geometry, WS 2007/08 Lecture 5 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät für.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2002 Tuesday, 5/7/02 Computational Geometry Chapter 33.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 2 Chapter 2: Polygon Partitioning.
UMass Lowell Computer Science Graduate Algorithms Prof. Karen Daniels Spring, 2009 Computational Geometry Overview from Cormen, et al. Chapter 33.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 3 Chapter 4: 3D Convex Hulls Chapter.
Complex Model Construction Mortenson Chapter 11 Geometric Modeling
Duality and Arrangements Computational Geometry, WS 2006/07 Lecture 7 Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik Fakultät.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 2 Chapter 2: Polygon Partitioning.
Brute-Force Triangulation
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
9-4 Geometry in Three Dimensions  Simple Closed Surfaces  Regular Polyhedra  Cylinders and Cones.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 O’Rourke Chapter 7 Search & Intersection.
C o m p u t i n g C O N V E X H U L L S. Presentation Outline 2D Convex Hulls –Definitions and Properties –Approaches: Brute Force Gift Wrapping QuickHull.
12. Polyhedra
Computational Geometry 2D Convex Hulls Joseph S. B. Mitchell Stony Brook University Chapter 2: Devadoss-O’Rourke.
Center for Graphics and Geometric Computing, Technion 1 Computational Geometry Chapter 8 Arrangements and Duality.
An Introduction to Computational Geometry: Polyhedra Joseph S. B. Mitchell Stony Brook University Chapter 6: Devadoss-O’Rourke.
Euler’s characteristic and the sphere
Arrangements and Duality Sanjay Sthapit Comp290 10/6/98.
Convex Hull. University of Manchester biologists used lasers to measure the minimum amount of skin required to wrap around the skeletons of modern-day.
1 / 41 Convex Hulls in 3-space Jason C. Yang. 2 / 41 Problem Statement Given P: set of n points in 3-space Return: –Convex hull of P: CH (P) –Smallest.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last Time: Plane Sweep Algorithms, Segment Intersection, + (Element Uniqueness)
Chapter Area, Pythagorean Theorem, and Volume 14 Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 O’Rourke Chapter 4: 3D Convex Hulls Thursday,
An Introduction to Computational Geometry Joseph S. B. Mitchell Stony Brook University.
UNC Chapel Hill M. C. Lin Delaunay Triangulations Reading: Chapter 9 of the Textbook Driving Applications –Height Interpolation –Constrained Triangulation.
Computational Geometry 2D Convex Hulls
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2010 O’Rourke Chapter 6 with some material.
Solid Modeling Prof. Lizhuang Ma Shanghai Jiao Tong University.
An Introduction to Computational Geometry: Arrangements and Duality Joseph S. B. Mitchell Stony Brook University Some images from [O’Rourke, Computational.
Polygon Triangulation
Computational Geometry
Incremental convex hulls BEN LEVY| DISCRETE ALGORITHMIC GEOMETRY

Convex Hull.
Computational Geometry
Introduction to Algorithms
14 Chapter Area, Pythagorean Theorem, and Volume
Presentation transcript:

UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Chapter 4: 3D Convex Hulls Friday, 2/9/07

Chapter 4 3D Convex Hulls PolyhedraAlgorithmsImplementation Polyhedral Boundary Representations Randomized Incremental Algorithm Higher Dimensions

Polyhedra: What are they? ä Polyhedron generalizes 2D polygon to 3D ä Consists of flat polygonal faces ä Boundary/surface contains ä 0D vertices1D edges2D faces ä Components intersect “properly.” Each face pair: ä disjoint or have vertex in common or have vertex/edge/vertex in common ä Local topology is “proper” ä at every point neighborhood is homeomorphic to disk ä Global topology is “proper” ä connected, closed, bounded ä may have holes not polyhedra! polyhedra for more examples, see source: O’Rourke, Computational Geometry in C

Polyhedra: A Flawed Definition ä Definition of Polyhedron 1 ä A polyhedron 1 is a region of space bounded by a finite set of polygons such that: ä every polygon shares at least one edge with some other polygon ä every edge is shared by exactly two polygons. - What is wrong with this definition? - Find an example of an object that is a polyhedron 1 but is not a polyhedron. polyhedra and polyhedra 1 ? not polyhedra and not polyhedra 1 ? source: O’Rourke, Computational Geometry in C

Polyhedra: A Resource

Polyhedra: Regular Polytopes ä Convex polyhedra are polytopes ä Regular polyhedra are polytopes that have: ä regular faces, = faces, = solid (dihedral) angles ä There are exactly 5 regular polytopes Excellent math references by H.S.M. Coxeter: - Introduction to Geometry (2nd edition), Wiley &Sons, Regular Polytopes, Dover Publications, 1973 source: O’Rourke, Computational Geometry in C

Polyhedra: Euler’s Formula Proof has 3 parts: 1) Convert polyhedron surface to planar graph 2) Tree theorem 3) Proof by induction V - E + F = 2 for genus 0 (no holes) source: O’Rourke, Computational Geometry in C

Algorithms: 2D Gift Wrapping ä Use one extreme edge as an anchor for finding the next  O(n 2 ) Algorithm: GIFT WRAPPING i 0 index of the lowest point i i 0 repeat for each j = i for each j = i Compute counterclockwise angle  from previous hull edge Compute counterclockwise angle  from previous hull edge k index of point with smallest  k index of point with smallest  Output (p i, p k ) as a hull edge Output (p i, p k ) as a hull edge i k i k until i = i 0 source: O’Rourke, Computational Geometry in C

Algorithms: 3D Gift Wrapping CxHull Animations: O(n 2 ) time [output sensitive: O(nF) for F faces on hull]

Algorithms: 2D Divide-and-Conquer ä Divide-and-Conquer in a geometric setting ä O(n) merge step is the challenge ä Find upper and lower tangents ä Lower tangent: find rightmost pt of A & leftmost pt of B; then “walk it downwards” ä Idea is extended to 3D in Chapter 4. Algorithm: 2D DIVIDE-and-CONQUER Sort points by x coordinate Divide points into 2 sets A and B: A contains left n/2 points B contains right n/2 points Compute ConvexHull(A) and ConvexHull(B) recursively Merge ConvexHull(A) and ConvexHull(B) O(nlgn) A B source: O’Rourke, Computational Geometry in C

Algorithms: 3D Divide and Conquer CxHull Animations: O(n log n) time !

Algorithms: 3D Divide and Conquer source: O’Rourke, Computational Geometry in C

Algorithms: 2D QuickHull ä Concentrate on points close to hull boundary ä Named for similarity to Quicksort a b O(n 2 ) Algorithm: 2D QUICK HULL function QuickHull(a,b,S) if S = 0 return() if S = 0 return() else else c index of point with max distance from ab c index of point with max distance from ab A points strictly right of (a,c) A points strictly right of (a,c) B points strictly right of (c,b) B points strictly right of (c,b) return QuickHull(a,c,A) + (c) + QuickHull(c,b,B) return QuickHull(a,c,A) + (c) + QuickHull(c,b,B) source: O’Rourke, Computational Geometry in C

Algorithms: 3D QuickHull CxHull Animations:

Algorithms for Qhull: Convex Hull boundary is intersection of hyperplanes, so worst-case combinatorial size (not necessarily running time) complexity is in:

Algorithms: 2D Incremental ä Add points, one at a time ä update hull for each new point ä Key step becomes adding a single point to an existing hull. ä Idea is extended to 3D in Chapter 4. O(n 2 ) Algorithm: 2D INCREMENTAL ALGORITHM Let H 2 ConvexHull{p 0, p 1, p 2 } for k 3 to n - 1 do H k ConvexHull{ H k-1 U p k } H k ConvexHull{ H k-1 U p k } can be improved to O(nlgn) source: O’Rourke, Computational Geometry in C

Algorithms: 3D Incremental ä Add points, one at a time ä Update hull Q for each new point p ä Case 1: p is in existing hull Q ä Discard p ä Case 2: p is not in existing hull Q ä Compute cone tangent to Q whose apex is p ä Cone consists of triangular tangent faces ä Base of each is an edge of Q ä Construct new hull using cone ä Discard faces that are not visible p Q source: O’Rourke, Computational Geometry in C

Algorithms: 3D Incremental O(n 2 ) Algorithm: 3D INCREMENTAL ALGORITHM Let H 3 ConvexHull{ p 0, p 1, p 2, p 3 } = tetrahedron for i 4 to n - 1 do for each face f of H i-1 do for each face f of H i-1 do compute volume of tetrahedron determined by f and p i mark f visible iff volume < 0 if no faces are visible then Discard p i (it is inside H i-1 ) else for each border edge e of H i-1 do for each border edge e of H i-1 do Construct cone face determined by e and p i for each visible face f do for each visible face f do Delete f Update H i Update H i Randomized incremental has expected O(nlgn) time. source: O’Rourke, Computational Geometry in C

Algorithms: 3D Incremental Main AddOne ReadVertices DoubleTriangle Print MakeNullVertex Collinear MakeFace VolumeSign ConstructHull MakeConeFace MakeCcw Cleanup CleanEdges CleanFaces CleanVertices MakeNullEdge MakeNullFace Calling Diagram for O’Rourke’s C Implementation of 3D Incremental Algorithm

Algorithms: 3D Incremental CxHull Animations: O(n 2 ) time

ä Clarkson, Shor (1989) ä O(nlgn) expected time ä Variant of 3D incremental algorithm ä Avoid brute-force visible face test ä Maintain CONFLICT GRAPH ä For each face of H i-1 record which not-yet-added points can see it ä For each not-yet-added point, record which faces it can see (those it is “in conflict” with) ä Key observation allowing fast adding of face = CH(e,p i ): ä If point sees a face, it must have been able to see one or both faces adjacent to e on H i-1 Algorithms: 3D Randomized Incremental

3D Visibility ä To build our 3D visibility intuition: ä T = planar triangle in 3D ä C = closed region bounded by a 3D cube frequent problem in graphics What is the largest number of vertices P can have for any triangle? T C source: O’Rourke, Computational Geometry in C

Polyhedral Boundary Representations winged edge f0f0f0f0 f1f1f1f1 e e1+e1+e1+e1+ e1-e1-e1-e1- e0+e0+e0+e0+ e0-e0-e0-e0- v1v1v1v1 v0v0v0v0 twin edge [ DCEL: doubly connected edge list* ] f0f0f0f0 f1f1f1f1 e e 4,0 v1v1v1v1 v0v0v0v0 - focus is on edge - edge orientation is arbitrary - represent edge as 2 halves - lists: vertex, face, edge/twin - more storage space - facilitates face traversal - can represent holes with face inner/outer edge pointer e’s twin v2v2v2v2 v7v7v7v7 v6v6v6v6 v5v5v5v5 v3v3v3v3 v4v4v4v4 e 0,1 source: O’Rourke, Computational Geometry in C * see also deBerg et al. for DCEL description

Polyhedral Boundary Representations: Quad-Edge - general: subdivision of oriented 2D manifold - edge record is part of: - endpoint 1 list - endpoint 2 list - face A list - face B list e 0,1 f0f0f0f0 f1f1f1f1 e 4,0 v1v1v1v1 v0v0v0v0 v2v2v2v2 v7v7v7v7 v6v6v6v6 v5v5v5v5 v3v3v3v3 v4v4v4v4 e 0,1 twin edge [DCEL: doubly connected edge list] e 0,0 e 1,0 e 2,0 e 3,0 e 5,1 e 6,1 e 7,1 e 1,1 e 5,1 e 6,1 e 7,1 e 1,0 e 0,0 e 2,0 e 3,0 e 4,0 e 1,1 source: O’Rourke, Computational Geometry in C unbounded face f1f1 f0f0 v0v0 v5v5 v6v6 v7v7 v1v1 v2v2 v3v3 v4v4