Package-level declarations

Types

Link copied to clipboard
class MedialAxis(val shape: Shape, val nodes: List<Vector2>, val branches: List<MedialAxisBranch>)

The medial axis of shape represented as a graph of branches connecting nodes. Nodes are branch end points (leaves, including convex corners of shape) and junctions. Branches that meet at a node share the node position exactly.

Link copied to clipboard
class MedialAxisBranch(val contour: ShapeContour, val start: Int, val end: Int)

A single run of the medial axis between two nodes.

Functions

Link copied to clipboard
fun medialAxis(shape: Shape, diagram: ConstrainedVoronoiDiagram, fitTolerance: Double? = null, pruneLength: Double? = null): MedialAxis

Computes the medial axis of shape from diagram, a ConstrainedVoronoiDiagram of a linear simplification of shape whose vertices lie on the boundary of shape (and no interior points).

Link copied to clipboard
fun Shape.medialAxis(samplingDistance: Double = 2.0, fitTolerance: Double = samplingDistance * 0.1, pruneLength: Double = samplingDistance * 2.0): MedialAxis

Computes the medial axis of this Shape.