Skip to contents

While straight skeletons are mostly used for offsetting, they can also in themselves be useful, e.g. for finding the central spine of a polygon. While the boundaries package does not provide a class for representing the straight skeleton itself (ie. the internal CGAL representation), you can get a representation of it as a polyline_set.

Usage

skeleton_interior(polygon, keep_boundary = FALSE, only_inner = FALSE)

Arguments

polygon

A polyclid_polygon vector

keep_boundary

Should the boundary (ie. the input polygon) be returned as part of the skeleton. This is useful if you are mainly interested in using the straight skeleton for partitioning the polygon based on its skeleton

only_inner

Should the returned skeleton only contain the inner bisectors of the skeleton (ie the parts not connected to the vertices of the input polygon). This effectively returns the spine of the polygon

Value

A polyclid_polyline_set vector

See also

Other straight skeleton functions: skeleton_limit(), skeleton_offset()

Examples


poly <- polyclid::denmark()[9]
plot(poly)


# Only return the bisectors
plot(skeleton_interior(poly))


# Only return the inner bisectors
plot(skeleton_interior(poly, only_inner = TRUE))


# Return both the skeleton and boundary
plot(skeleton_interior(poly, keep_boundary = TRUE))