Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf ·...

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

Transcript of Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf ·...

Page 1: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Flavor of Computational Geometry

Convex Hull in 2D

Shireen Y. ElhabianAly A. Farag

University of LouisvilleFebruary 2010

Page 2: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Agenda

• Introduction

• Definitions of Convexity and Convex Hulls

• Naïve Algorithms for Extreme Points

• Gift Wrapping

• QuickHull

• Graham’s Algorithm

• Incremental Algorithm

Page 3: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Introduction

Page 4: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• Convex hull (or the hull) is perhapsthe most commonly used structurein computational geometry.

• It can be used in variousapplications, let’s mention a few here;

• Having a robot which tries to avoidobstacles as it moves, if its convexhull succeeded to avoid suchobstacles, the robot itself won’t hitany of them.

• Hence computing paths for robotswhich avoid collision becomes mucheasier if we are dealing with a convexrobot rather than a non-convex one.

Goal

Obstacle

Robot

RobotConvexHull

Page 5: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• In some applications, we need to find therectangle with the smallest area whichencloses a certain polygon.

• It was found that such rectangle has oneof its sides coincides with the convexhull of the polygon.

• Hence computing the hull can be used asthe first step of minimum rectanglealgorithms.

• Likewise, finding the smallest 3-dimensional box surrounding certainobject in space will definitely depend oncomputing the convex hull of suchobject.

Page 6: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• In the field of shapeanalysis, shapes can beclassified for matchingpurposes by theirconvex deficiency trees,which are structuresthat mainly depend onfinding convex hulls.

(a)

(b)

(c)

(d)

Example of convex deficiencytree (a) the polygon and itsconvex hull (b) deficienciesand their hulls (c) deficienciesof polygons from (b), (d)deficiency of the one non-convex piece from (c).

Page 7: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• Informally,

– The convex hull of a set of points in the plane is the shapetaken by a rubber band stretched around nails pounded intothe plane at each point.

– The boundary of the convex hull of points in threedimensions is the shape taken by plastic wrap stretchedtightly around the points.

• Now let’s move for more formal definitions forconvexity and convex hulls.

Page 8: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Definitions of Convexity and Convex Hulls

Page 9: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

x

y

It should be clear that for a given polygon, any region with a dent isnot convex, since two points spanning the dent can be found such thatthe segment they determine contains points exterior to the polygon,hence any polygon with a reflex vertex is not convex.

Page 10: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 11: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 12: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

An example of a convex hull (dashed line) surrounding a given polygon

Note that the convex hull ofa set is a closed "solid"region, including all thepoints inside.

Often the term is used moreloosely in computationalgeometry to mean theboundary of this region,since it is the boundary wecompute, and that implies theregion.

We will use the phrase "onthe hull" to mean "on theboundary of the convexhull."

Page 13: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• We will be concentrating on algorithms for constructing theboundary of the convex hull of a finite set of points in twodimensions, starting from inefficient algorithms, graduallyworking towards an optimal algorithm.

• However, before starting talking about algorithms, we shouldfirst know what we expect from such algorithms, in particularwhat do we mean by constructing the boundary? Four outputscan be distinguished:

– All points on the hull in arbitrary order

– The extreme points in arbitrary order

– All the points on the hull in boundary traversal order

– The extreme points in boundary traversal order

Page 14: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Extreme points

Non-extreme points

Extreme points are the vertices of the convex hull at which the interior angle is strictly convex, i.e. less than

Page 15: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• Let us concentrate on identifying the extreme points. Note that the highest point of S, theone with the largest y coordinate, is extreme if it is unique, or even if there are exactly twoequally highest vertices (both can then be extreme). The same is of course true of the lowestpoints, the rightmost points, and the leftmost points.

• It should be clear that a point is extreme if and only if there exists a line through that pointthat otherwise does not touch the convex hull. Such "there exists" formulations, however, donot immediately suggest a method of find such extreme points.

Extreme points

Non-extreme points

A point is extreme if andonly if there exists a linethrough that point thatotherwise does not touch theconvex hull.

Page 16: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Naïve Algorithms for Extreme Points

Let us therefore look at the other side of the coin, the non-extreme points.

Page 17: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Non-extreme Points

Logically, if we identify the non-extremepoints, this would be enough to identify theextreme points, hence let’s define non-extreme point

Page 18: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 19: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Extreme Edges

However, it is somewhat easier to identifyextreme edges rather than non-extreme(interior) points, where extreme edges areedges of the convex hull.

Page 20: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

S

Extreme Edge

Non-extreme Edge

Let S be a set of distinct points, the red line is an extreme edge since every point of Sis on or to one side of the line determined by that edge, on the other hand, the blueline is not an extreme edge since there are some points in S which lie on the right ofthe line determined by such edge.

Page 21: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

S

x

y

z

Page 22: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Gift Wrapping

Let’s now move to a more realistic hull algorithm.With a minor variation on the Extreme Edgealgorithm, we can both accelerate it by a factor of nand at the same time output the points in the orderin which they occur around the hull boundary.

Page 23: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Let the red line be a detected extreme edgewith x be the unlinked endpoint, we need tosearch for the next extreme edge e which willshare the unlinked endpoint x. The next edgee makes the smallest angle θ with respect tothe previous edge.

S

xe

θ

Page 24: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

QuickHull

The basic idea is very simple; Intuitively, wecan discard many points which are interior tothe hull and then concentrate on thosepoints which are closer to the hull boundary.

Page 25: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 26: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

x

y

a

b

c

Page 27: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Graham’s Algorithm

Now, it is time for the most efficientalgorithm to compute the convex hull of agiven set of points in plane which operatesin O(nlogn) time

Page 28: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Top Level Description

The basic idea of Graham's algorithm is quitesimple. We will first explain it with an example,making several assumptions that will be removedlater. Let’s assume the general position assumptionwhere there is no three points in the given set arecollinear.

Page 29: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

ji

g

d b

ac

xh

e

f

Example for Graham’s algorithms, x = (2,1); S= {(7,4),(6,5),(3,3),(0,5),(-2,3),(-2,2),(-5,1),(0,0),(-3,-2),(3,-2)}.

Page 30: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

ji

g

d b

ac

xh

e

f

Example for Graham’s algorithms, x = (2,1); S= {(7,4),(6,5),(3,3),(0,5),(-2,3),(-2,2),(-5,1),(0,0),(-3,-2),(3,-2)}.

Page 31: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

ji

g

d b

ac

xh

e

f

Example for Graham’s algorithms, x = (2,1); S= {(7,4),(6,5),(3,3),(0,5),(-2,3),(-2,2),(-5,1),(0,0),(-3,-2),(3,-2)}.

Page 32: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

ji

g

d b

ac

xh

e

f

Example for Graham’s algorithms, x = (2,1); S= {(7,4),(6,5),(3,3),(0,5),(-2,3),(-2,2),(-5,1),(0,0),(-3,-2),(3,-2)}.

Page 33: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

ji

g

d b

ac

xh

e

f

Example for Graham’s algorithms, x = (2,1); S= {(7,4),(6,5),(3,3),(0,5),(-2,3),(-2,2),(-5,1),(0,0),(-3,-2),(3,-2)}.

Page 34: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

ji

g

d b

ac

xh

e

f

Example for Graham’s algorithms, x = (2,1); S= {(7,4),(6,5),(3,3),(0,5),(-2,3),(-2,2),(-5,1),(0,0),(-3,-2),(3,-2)}.

Page 35: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Pseudo code, Version A• Let’s now summarize the rough algorithm in the following pseudo code, where we

assume stack primitives Push(p, S) and Pop(S), which push p onto the top of the stack S,and pop the top off, respectively. We use t to index the stack top and i for the angularlysorted points.

Page 36: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Details: Boundary Conditions

Now it is time to discuss details relatedto various boundary conditions whichhave been ignored so far.

Page 37: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Start and Stop of Loop

Page 38: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Sorting Origin

Page 39: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

09

8

4 2

13

x7

5

6

New sorting origin for the points in the previous example, where thelowest rightmost point is considered to be our origin around which otherpoints are angularly sorted.

Page 40: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Collinearities

The final "boundary condition" we consider is thepossibility that three or more points are collinear.This issue affects several aspects of the algorithm.First we focus on defining precisely what we seek asoutput.

Page 41: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 42: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

0 2 4 6-2-4

-2

2

4

018

15 9

3

2

4

x12

13 11

1

5

678

10

14

16

17

Sorting points with collinearities, indices indicate sorting rank, points to bedeleted are shown as open circles.

Page 43: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Pseudo code, Version B

Page 44: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Incremental Algorithm

The difficulty is that Graham's algorithm has noobvious extension to three dimensions: It dependscrucially on angular sorting, which has no directcounterpart in three dimensions. So we nowproceed to describe one further algorithm in twodimensions which can be extended to threedimensions.

Page 45: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 46: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 47: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 48: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Q

p

i-1 i

i+1

j-1

jj+1

left

!left

left

Page 49: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Flavor of Computational Geometry

Convex Hull in 3D

Shireen Y. ElhabianAly A. Farag

University of LouisvilleFebruary 2010

Page 50: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Agenda

• Polyhedra

– Introduction

– Regular Polytopes

– Euler’s Formula

• Incremental Algorithm in 3D

Page 51: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Polyhedra

The focus of this section is discussingalgorithm for constructing the convex hullof a set of points in three dimensions. Wewill also touch basis on some properties ofpolyhedra and how to represent polyhedra.

Page 52: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Introduction

Page 53: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• In this section we are mainly concerned with convex polyhedra,which are simpler than general polyhedra.

• The boundary or surface of a polyhedron is composed of threetypes of geometric objects:

– zero-dimensional vertices (0-cells, i.e. points),

– one-dimensional edges (1-cells, i.e. segments), and

– two-dimensional faces (2-cells, i.e. polygons).

• Faces can be convex polygons, which are defined to be bounded,without losing generality, since non-convex polygons/faces canbe partitioned into convex ones, however we must then allowadjacent faces to share the same plane, i.e. coplanar.

Page 54: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• There are certain conditions which should be satisfied toconstruct a valid polyhedral surface, such conditions defines howpolyhedral surface components are related to each other. Wehave three types of conditions:

– The components intersect "properly,"

– the local topology is "proper," and

– the global topology is "proper."

• Now let’s discuss these conditions in details

Page 55: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

1. Components intersect "properly."

• For each pair of faces, we require thateither

– they are disjoint, or

– they have a single vertex in common, or

– they have two vertices, and the edge joiningthem, in common.

• Having convex faces simplifies theseconditions.

• Improper intersections include not onlypenetrating faces, but also faces touchingin the "wrong" way.

BA C

Faces A and B meet face Cimproperly even though they donot penetrate C

• There is no need to specify conditions on the intersection of edges and vertices,as the condition on faces covers them also. Thus an improper intersection of apair of edges implies an improper intersection of faces.

Page 56: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

2. Local topology is "proper."• Geometrically, the local topology is what the surface looks like in the

vicinity of a point.

• This notion can be made precise via the notion of neighborhoods which arearbitrarily small portions (open regions) of the surface surrounding apoint.

• The points should have neighborhoods that are topological two-dimensional disks, i.e. neighborhoods of every point on the surface is"homeomorphic" to a disk, where a homeomorphism between two regionspermits stretching and bending, but no tearing.

• A bug walking on the surface would find the neighborhood of every pointto be topologically like a disk.

• A surface for which every point have a neighborhood homeomorphic toan open disc is called a 2-manifold, which is a class more general than theboundaries of polyhedra.

Page 57: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

2. Local topology is "proper."• Moving to a combinatorial description to this condition, suppose we triangulate the

polygonal faces, then every vertex is the apex of a number of triangles. Let’s define thelink of a vertex as follows;

• One consequence of this condition is that every edge is shared by exactly two faces.

Vertex v

Faces share v

Link of vertex v

An example of a valid polyhedralsurface, where the link of avertex v is defined to be thecollection of edges opposite to vin all the triangles incident to v.Thus the link is in a sense thecombinatorial neighborhood ofv. For a legal triangulatedpolyhedron, we require that thelink of every vertex be a simple,closed polygonal path.Polyhedron

Page 58: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

(a)

(b)(c)

Example of (a) a simple polygonal chain (b) a self-intersecting polygonal chain and (c) a closedpolygonal chain

Page 59: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

(a)

(b)

(c)

Three objects that are not polyhedra. In allthree cases, a neighborhood of the circledpoint is not homeomorphic to an open disk.In (a) the point lies both on the top surfaceshown and on a similar surface underneath.Object (c) is not closed, so the indicatedpoint's neighborhood is a half-disk.

Page 60: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

3. Global topology is "proper."• We would like the surface to be connected, closed, and bounded. So we

require that the surface be connected in the sense that from any point, onemay walk to any other point on the surface.

• This can be stated combinatorially by requiring that the 1-skeleton, the graphof edges and vertices, be connected.

• Such condition with emphasizing having a finite number of faces, ourprevious conditions already imply closed and bounded surfaces.

• One might be inclined to rule out "holes" in the definition of polyhedron,holes in the sense of "channels" from one side of the surface to the otherthat do not disconnect the exterior (unlike cavities).

• Should a torus (a shape like a doughnut) be a polyhedron? We adopt the usualterminology and permit polyhedra to have an arbitrary number of such holes.The number of holes is called the genus of the surface.

• Normally we will only consider polyhedra with genus zero: thosetopologically equivalent to the surface of a sphere.

Page 61: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

In Summary …

• The boundary of a polyhedron is a finite collection of planar,bounded convex polygonal faces such that:

– the faces intersect properly;

– the neighborhood of every point is topologically an opendisk, or (equivalently) the link of every vertex is a simplepolygonal chain; and

– the surface is connected, or (equivalently) the 1-skeleton isconnected.

• The boundary is closed and encloses a bounded region of space.Every edge is shared by exactly two faces; these faces are calledadjacent.

Page 62: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

The dihedral angle (pale red) is the part ofthe space between two half-planes (paleblue).

Page 63: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Regular Polytopes

Page 64: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• The surprising implication of these regularity conditions is thatthere are only five distinct types of regular polytopes. These areknown as the Platonic solids.

• We now prove that there are exactly five regular polytopes.

• The proof is very elementary. The intuition is that the internalangles of a regular polygon grow large with the number ofvertices of the polygon.

Page 65: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 66: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 67: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 68: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Tetrahedron OctahedronCube

Dodecahedron Icosahedron

Page 69: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Euler’s Formula

Leonhard Paul Euler (15 April 1707 – 18 September 1783) was a pioneering Swiss mathematician andphysicist who spent most of his life in Russia and Germany.Euler made important discoveries in fields as diverse as calculus and graph theory. He also introduced muchof the modern mathematical terminology and notation, particularly for mathematical analysis, such as thenotion of a mathematical function.

Page 70: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

• In 1758 Leonard Euler noticed a remarkable regularity in the numbers ofvertices, edges, and faces of a polyhedron of genus zero:

– The number of vertices and faces together is always two more than the numberof edges; and this is true for all polyhedra.

• So a cube has 8 vertices and 6 faces, and 8 + 6 = 14 is two more than its 12edges. And the remaining regular polytopes can be seen to satisfy the samerelationship.

Page 71: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Incremental Algorithm in 3D

Page 72: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 73: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 74: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

(a) (b)

Page 75: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

(a) (b)

Page 76: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 77: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 78: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag
Page 79: Flavor of Computational Geometry Convex Hull in 2Dshireen/pdfs/tutorials/Elhabian_hull10.pdf · Flavor of Computational Geometry Convex Hull in 2D Shireen Y. Elhabian Aly A. Farag

Thanks