Skip to contents

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.

Usage

skeleton_offset(polygon, offset)

Arguments

polygon

A polyclid_polygon vector. If shorter than offset it will be recycled to the length of offset

offset

An euclid_exact_numeric or numeric vector. If shorter than polygon it will be recycled to the length of polygon

Value

A polyclid_polygon_set vector

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)))