Package-level declarations

Functions

Link copied to clipboard
fun List<Vector2>.minimumVariationCurve(closed: Boolean, tolerance: Double = 0.01, polarity: YPolarity = YPolarity.CW_NEGATIVE_Y): ShapeContour

Converts this polyline into a minimum-variation curve (MVC) through all points: the G2 curve that minimizes the variation of its curvature, ∫(dκ/ds)² ds, after Moreton and Séquin, "Functional optimization for fair surface design" (SIGGRAPH 1992). The variation shrinks as a curve grows, so where the curve loops it has no minimum: the loop would inflate without end. The scale-invariant form, the variation times the cube of the curve length, is minimized instead; it has the same minimizers up to how the length is weighed in, and a circle still scores zero. Where clothoid splines let the curvature change linearly along every segment, the MVC lets it change as little as possible over the whole curve, so it is fairer still. Points on a circle give that circle, the curve with zero variation, and collinear points a straight line.