Given a list of polygonal lines, compute the offset region (guard region,
buffer region, morphological dilation) formed by shifting the
boundary outwards by a specified distance.
Distance over which the boundary should be shifted.
...
Ignored.
eps
Spatial resolution for coordinates.
x0,y0
Spatial origin for coordinates.
miterlim,arctol
Tolerance parameters: see Details.
jointype
Type of join operation to be performed at each vertex.
See Details.
endtype
Type of geometrical operation to be performed at the start and end
of each line. See Details.
Details
This is part of an interface to the polygon-clipping library
Clipper written by Angus Johnson.
Given a list of polygonal lines A,
the function polylineoffset computes the offset region
(also known as the morphological dilation, guard region,
buffer region, etc) obtained by shifting the boundary of A
outward by the distance delta.
The argument A represents a polygonal line (broken line)
or a list of broken lines. The format is either
a list containing two components x and y
giving the coordinates of successive vertices of the broken line.
a list of list(x,y) structures giving
the coordinates of the vertices of several broken lines.
Lines may be self-intersecting and different lines may intersect each other.
Note that calculations are performed in integer arithmetic: see below.
The argument jointype determines what happens at the vertices
of each line. See the Examples for illustrations.
jointype="round": a circular arc is generated.
jointype="square": the circular arc is
replaced by a single straight line.
jointype="miter": the circular arc is
omitted entirely, or replaced by a single straight line.
The argument endtype determines what happens at the beginning
and end of each line. See the Examples for illustrations.
endtype="closedpolygon": ends are joined together (using the
jointype value) and the path filled as a polygon.
endtype="closedline": ends are joined together (using the
jointype value) and the path is filled as a polyline.
endtype="openbutt": ends are squared off abruptly.
endtype="opensquare":
ends are squared off at distance delta.
endtype="openround": ends are replaced by a semicircular arc.
The values endtype="closed", "butt", "square"
and "round" are deprecated; they are
equivalent to endtype="closedpolygon",
"openbutt", "opensquare" and "openround"
respectively.
The arguments miterlim and arctol are tolerances.
if jointype="round", then arctol is the maximum
permissible distance between the true circular arc and its
discretised approximation.
if jointype="miter", then miterlimit * delta
is the maximum permissible displacement between the original vertex and the
corresponding offset vertex if the circular arc were to be
omitted entirely. The default is miterlimit=2
which is also the minimum value.
Calculations are performed in integer arithmetic
after subtracting x0,y0 from the coordinates,
dividing by eps, and rounding to the nearest integer.
Thus, eps is the effective spatial resolution.
The default values ensure reasonable accuracy.
Value
Data specifying polygons, in the same format as A.
Chen, X. and McMains, S. (2005)
Polygon Offsetting by Computing Winding Numbers.
Paper no. DETC2005-85513 in Proceedings of IDETC/CIE 2005
(ASME 2005 International Design Engineering Technical Conferences
and Computers and Information in Engineering Conference),
pp. 565–575
http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf