exact and efficient construction of planar minkowski sums using the convolution method
DESCRIPTION
Exact and Efficient Construction of Planar Minkowski Sums Using the Convolution Method. Ron Wein. 14 th ESA Zuirch, July 2006. Computing Minkowski Sums. . =. Planar Minkowski Sums. Given two sets A and B in the plane, their Minkowski sum, denoted A B , is: - PowerPoint PPT PresentationTRANSCRIPT
Exact and Efficient Construction of Planar Minkowski Sums Using the Convolution MethodRon Wein 14th ESA
Zuirch, July 2006
Computing Minkowski Sums
Given two sets A and B in the plane, their Minkowski sum, denoted A B, is:
A B = {a + b | a A, b B}
Planar Minkowski Sums
=
We are given two polygons P and Q with m and n vertices respectively. If both polygons are convex, the complexity of their sum is m + n, and we can compute it in (m + n) time using a very simple procedure.
The Sum Complexity (I)
If only one of the polygons is convex, the complexity of their sum is (mn).
If both polygons are non-convex, the complexity of their sumis (m2n2).
The Sum Complexity (II)
The prevailing method for computing the sum of two non-convex polygons: Decompose P and Q into convex sub-polygons, compute the pair-wise sums of the sub-polygons and obtain the union of these sums.
The Decomposition Method
P
QP1
P2
Q1
Q2P Q
Given a set of polygons P1, …, Pk with counterclockwise (positive) orientation, construct the arrangement of their edges.
Set N(fu) = 0 for the unbounded face fu. Then compute N(f ) for each other face using a simple BFS traversal.
All faces with N(f ) > 0 contribute to the union.
Computing the Union
(0)
(1)
(1)
(1)
(2)
(2)
(0)
A planar tracing T comprises a continuous set of points. Each point t T is associated with a direction dir(t).
The convolution of two planar tracings S and T, denoted S T, comprises the pair-wise sum of all points s S and t T such that dir(s) = dir(t).
Convolution of Planar Tracings(Guibas, Ramshaw and Stolfi, 1983)
S T
st
A polygonal tracing P consists of moves (going along an edge in a fixed direction), and turns (rotating at a vertex).
For a vertex p of P, dir(p) is a continuous range of directions. The convolution P Q therefore contains the sum of each edge of the polygonal tracing Q, whose direction is in dir(p), with p.
Convolution of Polygons (I)
p
dir(p)P
Q
At the worst case, the convolution of two polygons P Q consists of (mn) line segments.
Guibas and Seidel (1987) gave an output-sensitive algorithm for computing the convolution segments in O(m + n + K) time.
The convolution segments form closed cycles. The Minkowski sum P Q contains all points whose winding number with respect to any of the convolution cycles is positive.
Convolution of Polygons (II)
(0)
(0)
(1) (2)
The Case of a Single Cycle
0
1
2
2 2
0
P Q
P Q
We compute the first cycle, starting from the two bottommost vertices in P and Q.
If P or Q are convex, we are done.Otherwise, while it is possible to locate two vertices p P andq Q that should be in the convolution, construct an additional convolution cycle.
The Case of Multiple Cycles
The Minkowski-Sum Package of CGAL
CGAL is a collaborative effort of several sites in Europe and Israel, a C++ library providing useful and reliable geometric algorithms.
Participating cites:
Utrecht University, The Netherlands
Tel-Aviv University, Israel
INRIA Sophia-Antipolis, France
ETH Zürich, Switzerland
MPII Saarbrücken, Germany
Freie Universität Berlin, Germany
About CGAL
Supports the construction of maintenance of 2D arrangements – planar subdivisions induced by a set of planes.
Handles a variety of curves. Each family of curves (line segments, polylines, circular arcs, conic arcs, etc.) is handled by a geometric traits-class.
The CGAL Arrangement Package
Common intersectionpoints
Tangencypoints
Handles degenerate cases robustly and accurately, using the exact computation paradigm.
The Minkowski-sum package re-implements the robust algorithms for sum-computations using the convex polygon-decomposition method (Agarwal, Flato and Halperin, 2000).
The Decomposition Method
Available decomposition methods:
Optimal.
Hertel-Mehlhorn’s approximation scheme.
Greene’s approximation scheme.
The small-side angle-bisector approximation scheme.
Implemented in thePartition_2 package
The first software that robustly implements the convolution algorithms for polygons.
Uses the same infrastructure for multi-way polygon union, used by the decomposition method. The same algorithm also works for the case of closed convolution cycles.
The Convolution Method
The Minkowski sum of two polygons may contain low-dimensional features (isolated vertices and antennas).
The package can treat themas follows:
discard them (output theregularized sum), or
give access to themthrough the underlyingarrangement.
Low-Dimensional Features
Experimental Input Sets (I)
chainstars
comb fork
Experimental Input Sets (II)
cavity random
knifecountry
Experimental Results: Decomposition
InputsetklS
Tdec (ms.)
Arrangement sizeRunning time (ms.)
|V||E||F|Opt.HMGre.SSAB
chain35725201237239136276390390424578444
stars1717244613129552562412671488744867477
comb261650467176910032581737
fork12111048668271337765522875241220260
cavity1411601167244798768
random20101540158209163108103234349376320
knife2261108977211515074312493701630232
country16813448512697724648338798410188
Experimental Results: Convolution
Input setNCK
Tconv (ms.)
Arrangement sizeRunning time (ms.)
|V||E||F|Conv.Decomp.LEDA
chain1145272077286879369390463
stars21200732255428225992477332
comb1603762765126171797
fork112665112032206310862521260266
cavity11101135161284621
random1580325894698211162234229
knife18765507597494676184232175
country21050519403064112661188275
Additional Capabilities:Polygon Offsetting
Polygon Offsetting using the Convolution Method
P Br
Computing the convolution cycle …Computing the induced arrangement and the winding numbers …
0
1
2
2 2
0
P Br
Offsetting a Polygon Edge (I)
p1 = (x1, y1)p2 = (x2, y2)
212
212 )()( yyxx
= - 90º
)(cos
)(sin
121
121
xx
yy
)(sincos
)(cossin
121
211
yy
xx
q1
q2
)(,)( 2112 xxyyyxq rj
rjj
If the line supporting p1p2 is ax + by + c = 0,then the line supporting q1q2 is ax + by + (c + ℓr) = 0.
Offsetting a Polygon Edge (II)
Problem: In the general case, offset arcs are not supported by rational lines!
Solution no. 1: Represent the offset edge as a segments of a (degenerate) conic curve with rational coefficients:
22
2 2
( )ax by cr
a b
Our Approximation Scheme
p1
p2
1. Find ’1 and ’2 such that sin(’j), cos(’j) are rational.
’1
’2
3. Compute the intersection q’ of the two tangents at q’1 and q’2.
Use the polyline q’1q’q’2
as an approximation.
q’
q’1
q’2
2. Compute q’j = (xj + rcos(’j) , yj + rsin(’j) ).
Running Times
(Pentium IV 3 GHz, in milliseconds)
Input polygon
SizeExact offset
Approximated offset
= 10-7r = 10-10r
Wheel40 (14)883554
Knife64 (40)13786071
Random40 (19)955668
Comb53 (24)1384550
Chain82 (37)1210109134
Country50 (24)4516682
❶
❺
❹❸
❷❶❷❸❹❺
Thank you!