Convex hulls in 3D Maciej Kot. Finding convex hull Given a set of points, find a convex hull that contains all of them and is minimal.

Slides:



Advertisements
Similar presentations
Alpha Shapes. Used for Shape Modelling Creates shapes out of point sets Gives a hierarchy of shapes. Has been used for detecting pockets in proteins.
Advertisements

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.
AVL Trees COL 106 Amit Kumar Shweta Agrawal Slide Courtesy : Douglas Wilhelm Harder, MMath, UWaterloo
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
Jarvis March Graham Scan Chan’s Algorithm
Planar Convex Hull 2013 / 5 / 9 Group 4 Sungheon Park Jeongho Son CS504 Presentation [CS504 Presentation]
algorithms and data structures
Computational Geometry II Brian Chen Rice University Computer Science.
CS16: Introduction to Data Structures & Algorithms
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.
The Divide-and-Conquer Strategy
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 
Theory of Algorithms: Divide and Conquer
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)
Polygons and the convex hull Prof. Noah Snavely CS1114
Advanced Algorithm Design and Analysis (Lecture 10) SW5 fall 2004 Simonas Šaltenis E1-215b
Informal Definition : Let S is set of nails sticking out from a board. the convex hull can be visualized as the shape formed by a tight rubber band that.
Algorithms and Data Structures Lecture 13. Agenda: Plane Geometry: algorithms on polygons - Verification if point belongs to a polygon - Convex hull.
What does that mean? To get the taste we will just look only at some sample problems... [Adapted from S.Suri]
Outline Scapegoat Trees ( O(log n) amortized time)
Computational Geometry Piyush Kumar (Lecture 3: Convexity and Convex hulls) Welcome to CIS5930.
Query Processing in Databases Dr. M. Gavrilova.  Introduction  I/O algorithms for large databases  Complex geometric operations in graphical querying.
1cs542g-term Notes. 2 Meshing goals  Robust: doesn’t fail on reasonable geometry  Efficient: as few triangles as possible Easy to refine later.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
Quicksort.
Clustering Color/Intensity
Convex Hull Algorithms for Dynamic Data Kanat Tangwongsan Joint work with Guy Blelloch and Umut Acar (TTI-C)
CS 206 Introduction to Computer Science II 12 / 03 / 2008 Instructor: Michael Eckmann.
Convex Hull Computation ● Applications of Convex Hull Computation ● Definitions ● Basic Math Functions ● Algorithms Algorithm Speed Discovered By Brute.
Polygons and the convex hull Prof. Noah Snavely CS1114
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2004 Chapter 4: 3D Convex Hulls Monday, 2/23/04.
Design and Analysis of Algorithms - Chapter 41 Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two.
Divide and Conquer The most well known algorithm design strategy: 1. Divide instance of problem into two or more smaller instances 2. Solve smaller instances.
Computational Geometry Convex Hulls Robust Geometric Primitives Degeneracy and Stability Nick Pilkington.
Convex Hull. What is the Convex Hull? Imagine a set of points on a board with a nail hammered into each point. Now stretch a rubber band over all the.
5 -1 Chapter 5 The Divide-and-Conquer Strategy A simple example finding the maximum of a set S of n numbers.
Computational Geometry Course Summary (First Half) Spring 2008 Pay special attention to: algorithm details (able to explain correctness and carry out a.
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.
Convex Hull of a 2D Simple Polyline Presenter: Yung-Hsing Peng Date:
Fundamental Data Structures and Algorithms Margaret Reid-Miller 27 April 2004 Computational Geometry.
1 Prune-and-Search Method 2012/10/30. A simple example: Binary search sorted sequence : (search 9) step 1  step 2  step 3  Binary search.
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.
Kansas State University Department of Computing and Information Sciences Friday, July 13, 2001 Mantena V. Raju Department of Computing and Information.
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
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
Robert Pless, CS 546: Computational Geometry Lecture #3 Last time Several convex hull algorithms. Lower bound of O(n log n) –O(n log h) for output sensitive.
Quicksort This is probably the most popular sorting algorithm. It was invented by the English Scientist C.A.R. Hoare It is popular because it works well.
Convex Hulls Guo Qi, Chen Zhenghai, Wang Guanhua, Shen Shiqi, Himeshi De Silva.
Polygon Triangulation
Data Structure & Algorithm 13 – Computational Geometry JJCAO.
MA/CSSE 473 Day 17 Divide-and-conquer Convex Hull
MA/CSSE 473 Day 16 Answers to your questions Divide and Conquer
Convex Hull.
Query Processing in Databases Dr. M. Gavrilova
Algorithm design techniques Dr. M. Gavrilova
Binary Search Back in the days when phone numbers weren’t stored in cell phones, you might have actually had to look them up in a phonebook. How did you.
August 20, 2002 (joint work with Umut Acar, and Guy Blelloch)
Localizing the Delaunay Triangulation and its Parallel Implementation
Algorithm design and Analysis
Ch 7: Quicksort Ming-Te Chi
CHAPTER 33 Computational Geometry
CMPS 3130/6130: Computational Geometry Spring 2017
Quicksort.
CMPS 3120: Computational Geometry Spring 2013
Quicksort.
Presentation transcript:

Convex hulls in 3D Maciej Kot

Finding convex hull Given a set of points, find a convex hull that contains all of them and is minimal.

Convex hull in 2D In 2D it seems to be easy. There are almost as many Convex Hull algorithms as sorting algorithms! Known algorithms: Brute force O(n 3 ) Incremental O(n 2 ) Jarvis’ march (gift wrapping) O(nh) Divide and Conquer O(n logn) Graham’s scan O(n logn) h is a number of points in the hull

Line pruning O(n 3 ) Point pruning O(n 2 ) QuickHull O(n logn ) Marriage before conquestO(n log h) Chan’s algorithmO(n log h) Monotone chainO(n logn) Many randomized algorithms O(n logn) O(n log h) Seidel’s shellingO(n 2 + h logn)

Can it be extended to higher dimensions ? Incremental Gift wrapping Divide and conquer QuickHull The problem of course can, but what about solutions? Some of them...and many others, but not all of them

Convex hull in 3D Similar as in 2D. Given set of points find a convex polyhedron that contains all of them. Picture from wikipedia

Convex hulls in 3d A line between every two points from the hull is always inside the hull (or at the border). For every face of the hull (triangle in 3d, edge in 2d) all the points that don’t lay on the face are either on the left or right side of that face. The problem in 3D seems to be more complicated. Is there a simple (and fast) solution? Look at the simple properties of convex hulls, maybe you’ll find a simple solution! Every point from our set has to be on the left side of every face of the hull....or on the right, depending on orientation of the hull

Incremental algorithm For each point we haven’t checked yet: Check if it’s inside the hull. How? - check if it can see any faces, if not - it’s inside (it’s on the left side of every face of the hull.) We are in the middle of algorithm. We have looked at some points and we have a hull that contains them (and is minimal). If it’s inside, life is good, don’t change it. If it’s outside, rebuild the hull so it will contain our point. //Lets assume, that point can see the face if it’s //on the right side of the face.

Incremental algorithm We have a hull, and a point that is outside. Delete all the faces that this point see. Add a cone that will repair it. For every edge of the hole add a triangle containing this edge and our point. This means that it can see some faces. There is a hole in the hull now. Rebuilding the hull. 2D3D

Incremental algorithm notes, summary We’ve already said what is the loop invariant: We have looked at some points and we have a hull that contains them (and is minimal). Establishing the loop invariant: Pick 4 random points and build a hull on them. Maintaining the loop invariant: Rebuilding the hull maintains the loop invariant. Exit condition: We have looked at all points.

Incremental algorithm Complexity For each point Look at every face in temporary hull and check if point can see it then Leave the hull unchanged or Remove some faces, add some new faces. n x O(n) =O(n 2 ) Can we do better? +

The best algorithm in 2D has O(n logh). Can we do it as fast in 3D? n logn sounds like recursion Divide your set of points in 2 groups. Let your friend compute a hull for first group, another friend for second group and then join them. But your friends are lazy. They may not want to compute anything for you. This algorithm is very hard to implement in higher dimensions.

Look at the incremental algorithm again.... When choosing first few points for the hull pick max(x), max(y), min(x) and min(y) points. These 4 points have to be in the final hull. Build a first temporary hull on them. Discard all points that are inside. In typical case, there won’t be many points left to look at now. This trick can speed up almost every convex hull algorithm.

QuickHull Speed of incremental algorithm depends on the order in which we are looking at our points. So each time pick the point that looks best! If we don’t know anything about input set, then the point that is furthest away gives us the biggest chance of catching other points into the hull. Furthest away from what? Center of the hull? Border of the hull. Is is a better idea. Checking if point can see a face, can give us distance between them. We have to do this check anyway. Face that point can see. It may not be easy to compute and we are lazy, right? - OK, but where is it?

QuickHull Loop: We are in the middle of algorithm. We have looked at some points and we have a hull that contains them (and is minimal). and Every unprocessed point is associated with a face that it can see (doesn’t matter which face). Select a face of the hull. Pick the furthest point associated with it. Add it to the hull. (rebuild the hull so it will contain this point) If there were no points associated with selected face, select the next face. If there is no next face - exit. The main idea: For each face of the hull pick the point that is furthest away from it and add it to the hull.

QuickHull Rebuilding the hull / maintaining the loop invariant. Similar as in incremental algorithm. We have a hull, and a point that is outside. Delete all the faces that this point see. There is a hole in the hull now. Add a cone that will repair it. For every edge of the hole add a triangle containing this edge and our point. Except this time, when adding new face, the points that were assigned to deleted faces are being reassigned to this new face if they can see it. If all needed faces are added, but there are still some points not assigned to any face, you can discard them - they can’t see any of newly added faces which means that they are inside the hull.

QuickHull Running time In typical cases it’s O(n log n) (in 2d and in 3D) Every point we are adding will be in the final hull. We discard all the points that won’t be in the final hull. Worst case scenario - All points from the input set will be in the hull (sphere). Then it’s O(n 2 ) worst case.

approximation of shapes collision detection shadow renderers Why did we do that? Where are convex hulls used? Problems that can be reduced to convex hull: halfspace intersection Delaunay triangulation Voronoi diagrams power diagrams

The end