3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College

Similar documents
3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College

Planar convex hulls (I) Computational Geometry [csci 3250] Laura Toma Bowdoin College

Computational Geometry 2D Convex Hulls. Joseph S. B. Mitchell Stony Brook University

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Spring, 2010

Convex Hulls in Three Dimensions. Polyhedra

Convex Hull Algorithms

Computational Geometry 2D Convex Hulls

Week 7 Convex Hulls in 3D

High-Dimensional Computational Geometry. Jingbo Shang University of Illinois at Urbana-Champaign Mar 5, 2018

Computational Geometry Overview from Cormen, et al.

Computational Geometry [csci 3250]

2D Geometry. Pierre Alliez Inria Sophia Antipolis

Last time. Today: Convex Hull Brute Force Inside(q,abc) Intersect(ab,cd) Orient(a,b,c).

Polygon Triangulation

Computational Geometry Lab: SEARCHING A TETRAHEDRAL MESH

CS 6463: AT Computational Geometry Spring 2006 Convex Hulls Carola Wenk

Prof. Gill Barequet. Center for Graphics and Geometric Computing, Technion. Dept. of Computer Science The Technion Haifa, Israel

Voronoi diagrams Delaunay Triangulations. Pierre Alliez Inria

Geometric Algorithms in Three Dimensions Tutorial. FSP Seminar, Strobl,

Computational Geometry

Flavor of Computational Geometry. Convex Hull in 2D. Shireen Y. Elhabian Aly A. Farag University of Louisville

Computational Geometry. Algorithm Design (10) Computational Geometry. Convex Hull. Areas in Computational Geometry

A Minimalist s Implementation of the 3-d Divide-and-Conquer Convex Hull Algorithm

Spherical Maze Generation

15-451/651: Algorithms CMU, Spring 2016 Lecture #24: Computational Geometry Introduciton April 13, 2015 Lecturer: Danny Sleator

Computational Geometry

Voronoi diagram and Delaunay triangulation

The Art Gallery Problem

Computational Geometry TOPICS Preliminaries Point in a Polygon Polygon Construction Convex Hulls

Computational Geometry [csci 3250]

COMPUTATIONAL GEOMETRY

1/60. Geometric Algorithms. Lecture 1: Introduction. Convex Hulls

Computational geometry

Geometry. Zachary Friggstad. Programming Club Meeting

The convex hull of a set Q of points is the smallest convex polygon P for which each point in Q is either on the boundary of P or in its interior.

General Pyramids. General Cone. Right Circular Cone = "Cone"

Computational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm

BSP Trees. Chapter Introduction. 8.2 Overview

Geometry 1-1. Non-collinear Points not on the same line. Need at least 3 points to be non-collinear since two points are always collinear

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

CSE 5311 Notes 13: Computational Geometry

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

COMP331/557. Chapter 2: The Geometry of Linear Programming. (Bertsimas & Tsitsiklis, Chapter 2)

Lecture 7: Computational Geometry

Polygon Triangulation

Computational Geometry. HKU ACM ICPC Training 2010

8.1 Geometric Queries for Ray Tracing

Algorithms for GIS. Spatial data: Models and representation (part I) Laura Toma. Bowdoin College

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

Graduate Algorithms CS F-19 Computational Geometry

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

Advanced Algorithm Homework 4 Results and Solutions

3D Rendering and Ray Casting

Computational Geometry csci3250. Laura Toma. Bowdoin College

Cross products. p 2 p. p p1 p2. p 1. Line segments The convex combination of two distinct points p1 ( x1, such that for some real number with 0 1,

5200/7200 Fall 2007 Concurrence theorems for triangles

Lecture 2: Divide and Conquer

There are two ways to name a line. What are the two ways?

An Introduction to Computational Geometry: Arrangements and Duality

Lecture 11 Combinatorial Planning: In the Plane

Stacks API and finding the convex hull. CS Spring 2017

We have already studied equations of the line. There are several forms:

notes13.1inclass May 01, 2015

Mathematical Analysis of Tetrahedron (solid angle subtended by any tetrahedron at its vertex)

arxiv: v1 [cs.cg] 11 Sep 2007

Three Dimensional Geometry. Linear Programming

Convex Hulls. Helen Cameron. Helen Cameron Convex Hulls 1/101

Motion Planning. O Rourke, Chapter 8

CS4733 Class Notes. 1 2-D Robot Motion Planning Algorithm Using Grown Obstacles

If three points A (h, 0), P (a, b) and B (0, k) lie on a line, show that: a b 1.

Surfaces: notes on Geometry & Topology

We have already studied equations of the line. There are several forms:

Intersection of planar figures. Intersection of a parallelogram and a triangle

COS 226 Lecture 15: Geometric algorithms. Warning: intuition may mislead (continued)

3D Rendering and Ray Casting

Convex Hulls (3D) O Rourke, Chapter 4

Rubber bands. Chapter Rubber band representation

MATH 116 REVIEW PROBLEMS for the FINAL EXAM

Exploring Translations

Optimal Compression of a Polyline with Segments and Arcs

FORMULAS to UNDERSTAND & MEMORIZE

3D Modeling Parametric Curves & Surfaces

(1) Page #2 26 Even. (2) Page 596 #1 14. (3) Page #15 25 ; FF #26 and 28. (4) Page 603 #1 18. (5) Page #19 26

CS 373: Combinatorial Algorithms, Fall Name: Net ID: Alias: U 3 / 4 1

Why Graham-Scan Needs to Sort Vertices Before Scanning

Class Generated Review Sheet for Math 213 Final

1 Appendix to notes 2, on Hyperbolic geometry:

We have set up our axioms to deal with the geometry of space but have not yet developed these ideas much. Let s redress that imbalance.

COT5405: GEOMETRIC ALGORITHMS

The statement implies that any three intersection points of two distinct planes lie on a line.

Linear Programming in Small Dimensions

Tutorial 3 Comparing Biological Shapes Patrice Koehl and Joel Hass

Lecture 3. Corner Polyhedron, Intersection Cuts, Maximal Lattice-Free Convex Sets. Tepper School of Business Carnegie Mellon University, Pittsburgh

Answer Key: Three-Dimensional Cross Sections

3. Voronoi Diagrams. 3.1 Definitions & Basic Properties. Examples :

Draw and Classify 3-Dimensional Figures

Computational Geometry

Intersecting Simple Surfaces. Dr. Scott Schaefer

7. The Gauss-Bonnet theorem

PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES

Transcription:

3D convex hulls Computational Geometry [csci 3250] Laura Toma Bowdoin College

Convex Hulls The problem: Given a set P of points, compute their convex hull 2D 3D

2D 3D polygon polyhedron

Polyhedron region of space whose boundary consists of vertices, edges and faces faces intersect properly neighborhood of any point on P is homeomorphic to a disk surface of P is connected

Convexity A polygon P is convex if for any p, q in P, the segment pq lies entirely in P. convex non-convex

Convexity A polyhedron P is convex if for any p, q in P, the segment pq lies entirely in P. convex non-convex

convex polyhedron : polytop

digression start

Regular polygons in 2D A regular polygon has equal sides and angles

Regular polytops in 3D Regular polytop: faces are congruent regular polygons the number of faces incident to each vertex is the same (and equal angles) Surprisingly, there exist only 5 regular polytops

digression end

Convex Hulls in 3D 3D convex hull = smallest convex polyhedron (polytope) that contains P

Convex Hulls in 3D 3D convex hull = smallest convex polyhedron (polytope) that contains P

Properties of 2d hull 2d hull consists of edges and vertices All edges of hull are extreme and all extreme edges of P are on the hull All points of hull are extreme and all extreme points of P are on the hull All internal angles are < 180 Walking counterclockwise > left turns Points on CH are sorted in radial order wrt a point inside

Properties of 3d hull 3d hull consists of: faces, edges and vertices All edges of hull are extreme and all extreme edges of P are on the hull All points of hull are extreme and all extreme points of P are on the hull All faces of hull are extreme and all extreme faces are on the hull All internal angles between faces are < 180 Walking counterclockwise > left turns Points on CH are sorted in radial order wrt a point inside

Faces, edges, vertices on the hull are extreme. 2D 3D

A dihedral angle is the angle between two intersecting planes. Angle between two planes (α, β, green) in a third plane (pink) which cuts the line of intersection at right angles

Computing the Hull 2D 3D Naive O(n 3 ) Gift wrapping O(nh) Graham scan O(n lg n) Extend to 3D? Quickhull O(n lg n), O(n 2 ) Incremental O(n lg n) Divide-andconquer O(n lg n)

3d hull: Naive algorithm Algorithm For every triplet of points (pi,pj,pk): check if plane defined by it is extreme if it is, add it to the list of CH faces Briefly sketch how to determine if a triplet is extreme and analyze it is_extreme(point3d a, point3d b, point3d c, vector<point3d> P) 3d hull naive: running time?

3d hull: Gift wrapping Algorithm find a face guaranteed to be on the CH REPEAT find an edge e of a face f that s on the CH, and such that the face on the other side of e has not been found. for all remaining points pi, find the angle of (e,pi) with f find point pi with the minimal angle; add face (e,pi) to CH Analysis: O(n x F), where F is the number of faces on CH

3d hull: Gift wrapping Algorithm find a face guaranteed to be on the CH REPEAT find an edge e of a face f that s on the CH, and such that the face on the other side of e has not been found. for all remaining points pi, find the angle of (e,pi) with f find point pi with the minimal angle; add face (e,pi) to CH To think finding first face? How to keep track of the hull? we ll need to store the connectivity (what faces are adjacent, for an edge which faces its adjacent to, etc) How to keep track of the boundary of the hull (the edges that have only one face discovered)?

Gift wrapping in 3D YouTube Video of CH in 3D (by Lucas Benevides) Fast 3D convex hull algorithms with CGAL

From 2D to 3D 2D 3D Naive O(n 3 ) O(n 4 ) Gift wrapping O(nh) O(n x F) Graham scan O(n lg n) Quickhull O(n lg n), O(n 2 ) does not extend to 3D Incremental O(n lg n) Divide-andconquer O(n lg n)

From 2D to 3D 2D 3D Naive O(n 3 ) O(n 4 ) Gift wrapping O(nh) O(n x F) Graham scan O(n lg n) does not extend to 3D Quickhull O(n lg n), O(n 2 ) yes Incremental O(n lg n) O(n 2 ) Divide-andconquer O(n lg n) O(n lg n)

Incremental 3D hull

Incremental CH = {p1,p2,p3} for i= 4 to n //CH represents the CH of p 1..p i-1 add p i to CH and update CH to represent the CH of p 1..p i 2D 3D

Terminology: Point in front/behind face c p b p a ps is left of (behind) abc abc not visible from p p is right of (in front) abc abc visible from p

2D 2 signedarea(a,b,c) = det a.x a.y 1 b.x b.y 1 c.x c.y 1 c positive area (c left/behind ab) b a c negative area (c right/in front of ab)

3D 6 signedvolume(a,b,c,d) = det a.x a.y a.z 1 b.x b.y b.z 1 c.x c.y c.z 1 d.x d.y d.z 1 c d positive volume (p behind face) a b negative volume (d in front of face)

Assume all faces oriented counterclockwise so that their normals determined by the right-hand rule point towards the outside of P. c p b p positive volume (p behind face) a negative volume (p in front of face) is_visible(a,b,c,p): return signedvolume(a,b,c,p) < 0

Incremental 3D The visible faces are precisely those that need to be discarded The edges on the boundary of the visible region are the basis of the cone

Incremental Algorithm: incremental hull 3d initialize H = p1, p2, p3, p4 for i = 5 to n do: for each face f of H do: compute volume of tetrahedron formed by (f,pi) if volume < 0: f is visible if no faces are visible discard pi (pi must be inside H) else find border edge of all visible faces for each border edge e construct a face (e,pi) and add to H for each visible face f: delete f from H

3d hull: divide & conquer The same idea as 2D algorithm divide points in two halves P1 and P2 recursively find CH(P1) and CH(P2) merge If merge in O(n) time ==> O( n lg n) algorithm

Merge Merged hull: cylinder without end caps

Merge Idea: Start with the lower tangent, wrap around, find one face at a time.

Merge Let PI be a plane that supports the hull from below Claim: When we rotate PI around ab, the first vertex hit c must be a vertex adjacent to a or b c has the smallest angle among all neighbors of a,b

Merge 1. Find a common tangent ab a b

Merge 1. Find a common tangent ab Now we need to find a triangle abc. If c is on the right hull, then bc is an edge on the right hull. a c b

Merge 1. Find a common tangent ab Now we need to find a triangle abc. If c is on the right hull, then bc is an edge on the right hull. Now we have a new edge ac that s a tangent. Repeat. a c b

Merge 1. Find a common tangent ab Now we need to find a triangle abc. If c is on the right hull, then bc is an edge on the right hull.. Now we have a new edge ac that s a tangent. Repeat. d a c b

Merge 1. Find a common tangent ab Now we need to find a triangle abc. If c is on the right hull, then bc is an edge on the right hull. Now we have a new edge ac that s a tangent. Repeat. a d e c b

Merge 1. Find a common tangent ab Now we need to find a triangle abc. If c is on the right hull, then bc is an edge on the right hull. Now we have a new edge ac that s a tangent. Repeat. a d e c b

Merge 1. Find a common tangent ab 2. Start from ab and wrap around, to create the cylinder of triangles that connects the two hulls A and B 3. Find and delete the hidden faces that are inside the cylinder

The hidden faces start from the edges on the boundary of the cylinder BFS or DFS faces towards the cylinder all faces reached are inside

3d hull: divide & conquer Theoretically important and elegant Of all algorithms that extend to 3D, DC& is the only one that achieves optimal ( n lg n) Difficult to implement The slower algorithms (quickhull, incremental) preferred in practice