Post on 09-Sep-2020
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 1
SMD156Lecture 16
Convex Hulls inHigher Dimensions
Projects andSurveys
3D
Voronoidiagrams Incremetal
Algorithm
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 2
Convex Hulls in 3D
• Collision detection:
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 3
Definitions
• The smallest volumepolyhedra that contains a setof points in 3D.# Facets
# Edges
# Vertices
• !Generalizes to higherdimensions."
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 4
Size of a Convex Hull in 3D
• !Theorem 11.1 + Corollary 11.2"# A convex hull in 3D with n vertices has at most
• 3n-6 edges and
• 2n-4 facets.
1. It is $planar$
2. Euler%s formula
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 5
Computing a Convex Hull in 3D
• Incremental Algorithm# Add points one at a time and maintain a current
convex hull.
# Use DCEL:s to represent the convex hull.
• Start with four !4" points that form a pyramid.
• Then add new facets for each pointconsidered that lie outside the current hull.# !and delete old facets that end up inside."
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 6
Horizon
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 7
Adding One Point
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 8
Deleting/Adding Facets
• The horizon can be found by traversing the!surface of the" convex hull.# Each edge of the horizon bounds two faces of
which just one is visible.• A point is visible to another point if the line
segment that is bounded by the points doesn%tintersect the interior of the convex hull.
• A face/edge is visible if all its points arevisible.
• Remove visible faces.# Easy since, by construction, each facet is oriented
counterclock-wise when seen from the outside ofthe convex hull.
• Insert new triangular facets for each edge inthe horizon unless…
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 9
• … the new face would be coplanar with anexisting face $behind$ the horizon, in whichcase the two are merged.
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 10
• Each time a linear number !in the size of thecurrent convex hull" of new facets replace asmany old facets.
• Total time: O!n2"
Worst-Case Analysis
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 11
• As on previous slide: Brute-force.
• Clever trick: Use a conflict graph.# Bipartite.
# Nodes for each point not yet considered.
# Nodes for each facet in the current convex hull.
# Arcs between points and facets that are visible toeach other.
• Maintain the conflict graph during thecomputation.
How to Find the Visible Facets
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 12
Conflict Graph
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 13
Using the Conflict Graph
• The facets visible to a point are its neighborsin the graph.
• Likewise: The points visible from a facet areits neighbors in the graph.
• The conflict sets of points and facets can beextracted in time linear in their sizes.
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 14
Adding a Point
• Using the conflict graph, we get the horizon and allvisible facets.
• Remove all visible facets, but keep those next to thehorizon in a separate data structure for a while.# Update the conflict graph accordingly
• When adding a new point # and new facets # to theconvex hull , we add new nodes to the conflict graphas well.
• The crucial point is how to construct their conflictlists.
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 15
Adding a Point (cont.)
• Consider adding a new face f.1. f is coplanar with f1 !$behind$ the horizon"
• ConflictList!f" = ConflictList!f1".
2. f is not coplanar with f1
• ConflictList!f" = Visible points of ConflictList!f1" andConflictList!f2".
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 16
f
New Faces lie Next to the Horizon
17 måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 18
Convex Hulls in 3D and Delaunay
Triangulations in 2D
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 19 måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 20
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 21
Conclusion
• The Delaunay triangulation/Voronoi diagramof a set of n points !xi, yi" in the plan can becomputed by computing the convex hull in3D of the points !xi, yi, xi
2+yi2".
# Extract the lower hull.
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 22
Conclusion
• !Lemma 11.4"# Given a set of n points in 3D, CONVEXHULL
computes a convex hull in O!n log n" expectedtime.
• Comment:# There is also a deterministic algorithm by
Preparata and Hong that runs in O!n log n" time,but that one is more complicated.
måndag 26 april 2004 SMD156 Computational Geometry - Håkan Jonsson 23