A straight skeleton is the structure made up of the angular bisectors of each
vertex in a polygon (see skeleton_interior()
for how to get the skeleton).
It can be used to offset polygons either inward or outward. This offsetting
technique will keep the corners of the polygon as-is.
Arguments
- polygon
A
polyclid_polygon
vector. If shorter thanoffset
it will be recycled to the length ofoffset
- offset
An
euclid_exact_numeric
or numeric vector. If shorter thanpolygon
it will be recycled to the length ofpolygon
See also
Other polygon offsetting:
minkowski_offset()
Other straight skeleton functions:
skeleton_interior()
,
skeleton_limit()
Examples
poly <- polyclid::denmark()
plot(poly, col = "grey")
# Negative offset (inset)
ins <- skeleton_offset(poly, -0.05)
euclid_plot(ins, lty = 2)
# Positive offset
off <- skeleton_offset(poly, 0.1)
euclid_plot(off, lty = 3)
# As can be seen, small sharp angles can become severely exaggerated with
# this offset type
plot(skeleton_offset(poly[9], c(0.01, 0.02, 0.04, 0.06, 0.1)))