Post on 03-Jul-2018
Polygon Partitioning
OโRourke, Chapter 2
Outline
โข Triangle Partitions
โข Convex Partitions
Monotonicity
A polygonal ๐ is monotone w.r.t. a line ๐ฟ if its
boundary can be split into two polygon
chains, ๐ด and ๐ต, such that each chain is
monotonic w.r.t. ๐ฟ.
๐ฟโฒ
๐๐ด ๐ต
๐ฟ
Monotonicity
A polygonal ๐ is monotone w.r.t. a line ๐ฟ if its
boundary can be split into two polygon
chains, ๐ด and ๐ต, such that each chain is
monotonic w.r.t. ๐ฟ.
A polygon ๐ is a monotone
mountain w.r.t. ๐ฟ if it is
monotone w.r.t. ๐ฟ and one
of the two chains (the base)
is a single segment.
๐ฟโฒ
๐ฟ
๐
Note: Both endpoints of the base have to be convex
Claim
Every strictly convex vertex of a monotone
mountain that is not on the base is an ear tip.
WLOG, we will assume that
๐ฟ is vertical and that the base
is to the left.
We will first show that the
diagonal has to be interior
and then that it cannot
intersect the polygon.
๐ฟโฒ
๐ฟ
๐
Proofs
Assume โ ๐ฃโ, ๐ฃ, ๐ฃ+ โ ๐, with ๐ฃ strictly
convex, s.t. ๐ฃโ๐ฃ+ is not an interior diagonal.
๐ฃ+๐ฃโ cannot be locally
exterior because: If ๐ฃ+ is not on the base, then
๐ฃ+๐ฃ++ must be below ๐ฃ+.
Since ๐ฃ is strictly convex,
๐ฃ+๐ฃโ is to the left of ๐ฃ+๐ฃ.
๐ฟ
๐ฃ
๐ฃ+
๐ฃโ
๐ฃ++
Proofs
Assume โ ๐ฃโ, ๐ฃ, ๐ฃ+ โ ๐, with ๐ฃ strictly
convex, s.t. ๐ฃโ๐ฃ+ is not an interior diagonal.
๐ฃ+๐ฃโ cannot be locally
exterior because: If ๐ฃ+ is on the base, then
๐ฃ+๐ฃโ is to the left of ๐ฃ+๐ฃ.
But it must also be to the right
of the base since ๐ฃโ is to the
right of the base.
๐ฟ
๐ฃโ
๐ฃ
๐ฃ+
Proofs
Assume โ ๐ฃโ, ๐ฃ, ๐ฃ+ โ ๐, with ๐ฃ strictly
convex, s.t. ๐ฃโ๐ฃ+ is not an interior diagonal.
โ If ๐ฃโ๐ฃ+ is not an interior
diagonal then โ๐ฅ โ ๐, reflex,
with ๐ฅ interior to ฮ๐ฃ+๐ฃ๐ฃโ. Interior โ it cannot lie on the
chain ๐ฃ+๐ฃ๐ฃโ.
Reflex โ it is not on the base.
โ The horizontal through ๐ฅintersects ๐ in three points.
๐ฅ
๐ฟ
๐ฃ
๐ฃ+
๐ฃโ
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Note:
We can induct because when we remove an ear,
we do not violate the monotonicity of the chain.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
Monotone Mountain Triangulation
Approach:
1. Find a convex vertex not on the base.
2. Remove it.
3. Go to step 1.
To do this, we need to be able
to quickly identify the next
convex vertex.
Recall:
Strictly convex โ interior angle < ๐.
Monotone Mountain Triangulation
MonotoneMountainTriangulation( ๐ ):โ ๐ต โFindBase( ๐ )โ ๐ถ โ LinkConvexVertices( ๐ โ ๐ต )โ while ๐ถ โ โ :
โข ๐ฃ โ First( ๐ถ )โข output( ฮ๐ฃโ๐ฃ๐ฃ+ )โข ๐ โ ๐ โ {๐ฃ}
โข if(๐ฃ+ โ ๐ถ AND ๐ฃ+ โ ๐ต )โข if( โ ๐ฃ+ < ๐ ) ๐ฃ.addAfter( ๐ฃ+ )
โข if( ๐ฃโ โ ๐ถ AND ๐ฃโ โ ๐ต )โข if( โ ๐ฃโ < ๐ ) ๐ฃ.addBefore( ๐ฃโ )
โข ๐ถ โ ๐ถ โ {๐ฃ}
Generating Monotone Mountains
Approach:
โข Compute a trapezoidalization of ๐.
โข Connect supporting vertices
that donโt come from
the same side.
Generating Monotone Mountains
Claim:
Such a partition generates pieces that are
monotone mountains.
Generating Monotone Mountains
Proof:
This algorithm removes all interior cusps,
so the partition pieces are monotone.
Proof:
Given a piece, we can find its topmost
vertex ๐ฃ, with neighbors ๐ฃโ and ๐ฃ+.
Assume ๐ฃ+ is lower than ๐ฃโ.
Generating Monotone Mountains
๐ฃ
๐ฃ+
๐ฃโ
Generating Monotone Mountains
Proof:
Following the chain down ๐ฃโ, we get to the
last vertex, ๐ค โ ๐, above ๐ฃ+.
There is a trapezoid
supported by ๐ค and ๐ฃ+.
Since ๐ค and ๐ฃ+ are on different
sides of the trapezoid, the diagonal
to ๐ฃ+ must be added.
โ ๐ฃ+ is a partition endpoint
๐ฃ
๐ฃ+
๐ฃโ
๐ค
Triangulation
Triangulate( ๐ ):โ Construct a trapezoidalization
Triangulation
Triangulate( ๐ ):โ Construct a trapezoidalizationโ Connect supporting vertices from different sides.
Triangulation
Triangulate( ๐ ):โ Construct a trapezoidalizationโ Connect supporting vertices from different sides.โ Triangulate the mountains
Triangulation
Note:
The algorithms for triangulating via monotone
polygons and monotone mountains works for
polygons with disconnected boundaries.
Outline
โข Triangle Partitions
โข Convex Partitions
Convex Partitions
Definition:A convex partition by segments of a polygon ๐ is
a decomposition of ๐ into convex polygons
obtained by introducing arbitrary segments.
Convex Partitions
Definition:A convex partition by segments of a polygon ๐ is
a decomposition of ๐ into convex polygons
obtained by introducing arbitrary segments.
A convex partition by diagonals
of a polygon ๐ is a decomposition
of ๐ into convex polygons obtained
by only introducing diagonals.
Convex Partitions
Definition:A convex partition by segments of a polygon ๐ is
a decomposition of ๐ into convex polygons
obtained by introducing arbitrary segments.
A convex partition by diagonals
of a polygon ๐ is a decomposition
of ๐ into convex polygons obtained
by only introducing diagonals.
Challenge:
Compute a convex partition with
the smallest number of pieces.
Challenge2:
Compute it efficiently
Convex Partitions (by Segments)
Claim (Chazelle):
Assume the polygon ๐ has ๐ reflex vertices.
If ฮฆ is the fewest number of polygons required
for a convex partition by segments of ๐ then:
๐/2 + 1 โค ฮฆ โค ๐ + 1
Convex Partitions (by Segments)
Proof (ฮฆ โค ๐ + 1):
For each reflex vertex, add the bisector.
Because the segment bisects, the reflex
angle splits into two convex angles.
(Angles at the new vertices have to be < ๐.)
Doing this for each reflex
vertices, gives a convex
partition with ๐ + 1 pieces.
Convex Partitions (by Segments)
Proof ( ๐/2 โค ฮฆ):
Each reflex vertex needs to be split and each
introduced segment can split at most two
reflex vertices.
Convex Partitions (by Diagonals)
Definition:
A diagonal in a convex partition is essential
for vertex ๐ฃ โ ๐ if removing the diagonal
creates a piece that is not convex at ๐ฃ.
Convex Partitions (by Diagonals)
Claim:
If ๐ฃ is a reflex vertex, it can have at most two
essential diagonals.
Proof:
Given a reflex vertex ๐ฃ, let ๐ฃโ and ๐ฃ+ be the
vertices immediately before and after ๐ฃ in ๐.
There can be at most one essential segment in
the half-space to the right of ๐ฃ๐ฃ+.
(If there were two, we could
remove the one closer to ๐ฃ๐ฃ+.)
Convex Partitions (by Diagonals)
๐ฃโ
๐ฃ+
๐ฃ
Proof:
Given a reflex vertex ๐ฃ, let ๐ฃโ and ๐ฃ+ be the
vertices immediately before and after ๐ฃ in ๐.
Similarly, there can be at most one essential
segment in the half-space to the right of ๐ฃ๐ฃโ.
Convex Partitions (by Diagonals)
๐ฃโ
๐ฃ+
Proof:
Given a reflex vertex ๐ฃ, let ๐ฃโ and ๐ฃ+ be the
vertices immediately before and after ๐ฃ in ๐.
Similarly, there can be at most one essential
segment in the half-space to the right of ๐ฃ๐ฃโ.
Since the two half-spaces
cover the interior of the vertex
there are at most two essential
vertices at ๐ฃ.
Convex Partitions (by Diagonals)
๐ฃโ
๐ฃ+
Convex Partitions (by Diagonals)
Algorithm (Hertl & Mehlhorn):
Start with a triangulation and remove inessential
diagonals.
Claim:
This algorithm is never worse
than 4 ร optimal in the number
of convex pieces.
Convex Partitions (by Diagonals)
Proof:
When the algorithm terminates, every remaining
diagonal is essential for some (reflex) vertex.
Each reflex vertex can have at most two
essential diagonals.
โ There can be at most 2๐ + 1pieces in the partition.
Since at least ๐/2 + 1 are
required, the result is within
4 ร optimal.
Convex Partitions
Why do we care?
Convex polygons are easier to intersect against.
For a polygon with ๐ vertices:
โข Testing if a point is inside is ๐(log ๐).
โข Testing if a line intersects is ๐(log ๐).
โข Testing if two polygons intersect is ๐(log ๐).
Point/Convex-Polygon Intersection
Algorithm:
Recursively split the polygon in half and test the
half the point could be in.
๐ฃ2 ๐ฃ3
๐ฃ5
๐ฃ6
๐ฃ8
๐ฃ7
๐ฃ1 ๐ฃ4๐
Point/Convex-Polygon Intersection
Algorithm:
Recursively split the polygon in half and test the
half the point could be in.
๐
๐ฃ2 ๐ฃ3
๐ฃ1 ๐ฃ4
Point/Convex-Polygon Intersection
Algorithm:
Recursively split the polygon in half and test the
half the point could be in.
๐
๐ฃ3
๐ฃ1 ๐ฃ4
Point/Convex-Polygon Intersection
InConvexPolygon( ๐ , {๐ฃ1, โฆ , ๐ฃ๐} ) if( ๐ == 3 )
ยปreturn InTriangle( ๐ , {๐ฃ1, ๐ฃ2, ๐ฃ3} ); if( Left( ๐ฃ1, ๐ฃ ๐ 2 , ๐ ) )
ยปreturn InConvexPolygon( ๐ , {๐ฃ ๐ 2, โฆ , ๐ฃ1} );
elseยปreturn InConvexPolygon( ๐ , {๐ฃ1, โฆ , ๐ฃ ๐ 2} );
Line/Convex-Polygon Intersection
Note:
Given a convex polygon ๐, a line segment ๐ฟ, and
vertices ๐ฃ๐ , ๐ฃ๐ โ ๐ on the same side of ๐ฟ.*
If the vector ๐ฃ๐๐ฃ๐+1 points
away from ๐ฟ, then ๐ฟ can
only intersect ๐ along the
chain {๐ฃ๐ , ๐ฃ๐+1, โฆ , ๐ฃ๐}.
Otherwise, ๐ฟ can only intersect
๐ along the chain {๐ฃ๐ , ๐ฃ๐+1, โฆ , ๐ฃ๐}.
๐ฃ๐
๐ฟ
๐ฃ๐
๐ฃ๐+1
*Assume, WLOG that ๐ฃ๐ is closer to ๐ฟ than ๐ฃ๐ .
Line/Convex-Polygon Intersection
Algorithm:
Recursively split the polygon in half.
If the split points are on the same side, test the
half of the polygon that
could intersect.
Otherwise there
is an intersection.
๐ฃ2 ๐ฃ3
๐ฃ5
๐ฃ6
๐ฃ8
๐ฃ7
๐ฟ
๐ฃ1 ๐ฃ4
Line/Convex-Polygon Intersection
Algorithm:
Recursively split the polygon in half.
If the split points are on the same side, test the
half of the polygon that
could intersect.
Otherwise there
is an intersection.
๐ฃ2
๐ฟ
๐ฃ4
๐ฃ3
๐ฃ1
Line/Convex-Polygon Intersection
IsectConvexPolygon( {๐1, ๐2} , {๐ฃ1, โฆ , ๐ฃ๐} ) if( ๐ == 3 )
ยปreturn IsectTriangle( {๐1, ๐2} , {๐ฃ1, ๐ฃ2, ๐ฃ3 ); if( Left( ๐1 , ๐2 , ๐ฃ1 )!=Left( ๐1 , ๐2 , ๐ฃ ๐ 2 ) )
ยปreturn true; else
ยปif( Dist( {๐1, ๐2} , ๐ฃ1 )<Dist( {๐1, ๐2} , ๐ฃ ๐ 2 )โ if( Dist( {๐1, ๐2} , ๐ฃ1 )<Dist( {๐1, ๐2} , ๐ฃ2 )
โข return IsectConvexPolygon( {๐1, ๐2} , {๐ฃ ๐ 2, โฆ , ๐ฃ1} );
โ else
โข return IsectConvexPolygon( {๐1, ๐2} , {๐ฃ1, โฆ , ๐ฃ ๐ 2} );
ยปelse...