Presentation is loading. Please wait.

Presentation is loading. Please wait.

UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.

Similar presentations


Presentation on theme: "UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04."— Presentation transcript:

1 UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04

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

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

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

16 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

17 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.

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

19 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 Problem: What is the largest number of vertices P can have for any triangle? T C

20 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

21 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


Download ppt "UMass Lowell Computer Science 91.504 Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04."

Similar presentations


Ads by Google