Presentation is loading. Please wait.

Presentation is loading. Please wait.

UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 3 Chapter 4: 3D Convex Hulls Chapter.

Similar presentations


Presentation on theme: "UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 3 Chapter 4: 3D Convex Hulls Chapter."— Presentation transcript:

1 UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 3 Chapter 4: 3D Convex Hulls Chapter 5: Voronoi Diagrams Wednesday, 2/21/01

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

3 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 http://www.ScienceU.com/geometry/facts/solids/handson.html

4 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. HW#3, Problem 1: - 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 ?

5 Polyhedra: A Resource

6 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, 1969 - Regular Polytopes, Dover Publications, 1973

7 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

8 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

9 Algorithms: 3D Gift Wrapping CxHull Animations: http://www.cse.unsw.edu.au/~lambert/java/3d/hull.html O(n 2 ) time [output sensitive: O(nF) for F faces on hull]

10 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: 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

11 Algorithms: 3D Divide and Conquer CxHull Animations: http://www.cse.unsw.edu.au/~lambert/java/3d/hull.html O(n log n) time !

12 Algorithms: 2D QuickHull ä Concentrate on points close to hull boundary ä Named for similarity to Quicksort a b O(n 2 ) Algorithm: 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)

13 Algorithms: 3D QuickHull CxHull Animations: http://www.cse.unsw.edu.au/~lambert/java/3d/hull.html

14 Algorithms: Qhull (>= 2D ) http://www.geom.umn.edu/software/qhull/

15 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: 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)

16 Algorithms: 3D Incremental CxHull Animations: http://www.cse.unsw.edu.au/~lambert/java/3d/hull.html O(n 2 ) time

17 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 HW#3, Problem 2: What is the largest number of vertices P can have for any triangle? T C

18 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

19 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

20 Chapter 5 Voronoi Diagrams Applications Preview Definitions & Basic Properties Delaunay Triangulations Algorithms Applications in Detail Medial Axis Connection to Convex Hulls Connection to Arrangements

21 Applications Preview ä Nearest neighbors ä Minimum spanning tree ä Medial axis http://www.ics.uci.edu/~eppstein/gina/scot.drysdale.html

22 Common Computational Geometry Structures Voronoi Diagram Delaunay Triangulation Convex Hull New Point

23 Basics ä Voronoi region V(p i ) is set of all points at least as close to p i as to any other site:

24 Delaunay Triangulations: Properties http://www.cs.cornell.edu/Info/People/chew/Delaunay.html

25 ä D1. D(P) is the straight-line dual of V(P) [by definition] ä D2. D(P) is a triangulation if no 4 points of P are cocircular: Every face is a triangle. ä D3. Each face of D(P) corresponds to a vertex of V(P) ä D4. Each edge of D(P) corresponds to an edge of V(P) ä D5. Each node of D(P) corresponds to a region of V(P) ä D6. The boundary of D(P) is the convex hull of the sites ä D7. The interior of each face of D(P) contains no sites

26 Delaunay Triangulations: Properties of Voronoi Diagrams http://www.cs.cornell.edu/Info/People/chew/Delaunay.html

27 Voronoi Diagram: Properties ä V1. Each Voronoi region V(p i ) is convex ä V2. V(p i ) is unbounded iff p i is on convex hull of point set ä V3. If v is a Voronoi vertex at junction of V(p 1 ), V(p 2 ), V(p 3 ), then v is center of circle C(v) determined by p 1, p 2, and p 3. ä V4. C(v) is circumcircle for Delaunay triangle for v ä V5. Interior(C(v)) contains no sites ä V6. If p i is a nearest neighbor to p j, then (p i, p j ) is an edge of D(P) ä V7. If there is some circle through p i and p j that contains no other sites, then (p i, p j ) is an edge of D(P). [reverse holds too]

28 Algorithms ä Half-Plane Intersection: ä Construct each Voronoi region separately: ä Intersect n-1 halfplanes ä O(n lg n) time ä Total time: O(n 2 lg n) ä Incremental Construction: ä Add one point at a time ä If new point is inside some Voronoi circle, locally update diagram ä O(n) work per point ä Total time: O(n 2 ) ä Divide-and-Conquer: O(n lg n)

29 Algorithms: Fortune ä Plane-sweep complication: ä what if encounter Voronoi edges before site? ä solution: ä Use expanding circles interpretation ä Sweep-line is intersection of slanted plane with xy-plane ä Event = intersection of 2 cones ä Maintain parabolic front = projection of intersection of slanted plane with xy-plane 45 slope timeO(nlgn) x sweep line L at x = l 

30 How are they related? Delaunay Triangulation ä Project each point upwards onto paraboloid z= x 2 + y 2 ä Construct 3D Convex Hull ä Discard “top” faces ä Project Convex Hull down to xy plane to form Delaunay Triangulation ä View from z = -infinity to see Delaunay Triangulation

31 How are they related? Voronoi Diagram ä Project each point upwards onto paraboloid z= x 2 + y 2 ä At each projected point, construct plane tangent to paraboloid ä tangent above (a,b) is ä z = 2ax + 2by - (a 2 + b 2 ) ä View from z = +infinity to see Voronoi Diagram ä “first intersection” of planes

32 Applications: Minimum Spanning Tree

33 Applications: Medial Axis Medial Axis Pruning: Robert Ogniewicz of Harvard uses medial axes for shape recognition. http://www.ics.uci.edu/~eppstein/gina/medial.html

34 Applications: Shewchuck Triangulation http://www.cs.cmu.edu/~quake/triangle.demo.html

35 Relative Neighborhood Graph The Relative Neighborhood Graph (RNG) of points p 1, p 2,..., p n is a graph: whose nodes correspond to the points - whose nodes correspond to the points 2 nodes p 1, p 2 share an arc iff they are at least as close to each other as to any other point: - 2 nodes p 1, p 2 share an arc iff they are at least as close to each other as to any other point: Note: this produces a set of constraints (1 for each m) HW#3, Problems 3,4: Prove: - every edge of the RNG is an edge of the Delaunay triangulation - every edge of an MST is an edge of the RNG LUNE forbidden region RNG for 4 sample points

36 Homework Summary 1Fri, 2/9 Wed, 2/14 Chapter 1 (O’Rourke) 2Mon, 2/12 Wed, 2/21 Chapters 2,3 (O’Rourke) problems 1 & 2 Extra credit may be turned in any time during week of 2/21 3 Wed, 2/21 Wed, 2/28 Chapters 4,5 (O’Rourke) HW# Assigned Due Content


Download ppt "UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 3 Chapter 4: 3D Convex Hulls Chapter."

Similar presentations


Ads by Google