Package-level declarations
Functions
Link copied to clipboard
Applies a deformation to the line segment by introducing intermediate control points influenced by an attractor vector and a specified strength.
fun ShapeContour.deform(attractor: Vector2, strength: Double, falloff: Double, refDistance: Double, errorTolerance: Double = 0.5, maxDepth: Int = 6, samplesPerPiece: Int = 24): ShapeContour
Deforms the current ShapeContour by applying an attraction force toward a given attractor point. The deformation is influenced by various parameters including strength, falloff, and reference distance, and adaptively refines the contour where necessary to meet an error tolerance.
fun Segment2D.deform(attractor: Vector2, strength: Double = 1.0, falloff: Double = 2.0, refDistance: Double = 1.0, endpointPinning: Double = 0.0, errorTolerance: Double = 0.5, maxDepth: Int = 6, samplesPerPiece: Int = 24): List<Segment2D>
Approximates the shape curve would take if every point on it were pulled toward attractor by a distance-weighted force, with both endpoints pinned. Adaptively splits into more pieces wherever a single cubic Bezier can't fit the displacement field within errorTolerance.