Spline is structured around a small set of geometry responsibilities that
can be reused without any Avalonia dependency.
Vec2 provides the package's basic 2D vector type.MathUtils and Polynomial support low-level numerical operations.CubicBezier and TwoCubics model Bezier control geometry and segment
transformations.BezierPath represents rendered output as commands and also supports
distance-based hit testing.Spline, TwoParamCurve, MyCurve, and TwoParamSpline form the existing
curvature-oriented fair-spline solving and rendering pipeline.GlobalBSpline is the CAD-oriented interpolation layer. It converts fit
points plus endpoint tangents into an explicit cubic B-spline control net in
O(n) time.BSplineCurve is the canonical non-rational B-spline geometry layer. It owns
degree, control points, knots, unit weights, de Boor evaluation, derivatives,
and exact cubic Bezier conversion.CurveGrid stores an interpolated grid of curve masters for the tuner
workflow.PolylineUtils provides headless simplification and resampling utilities for
converting traced input into spline control points.The fair-spline and CAD B-spline subsystems intentionally share low-level geometry but not their solver state:
Spline.CP[]
-> Spline / TwoParamSpline
-> tangent + curvature solve
-> BezierPath
fit Vec2[] + endpoint tangents
-> GlobalBSpline
-> BSplineCurve { degree, control points, knots, weights }
-> de Boor evaluation or exact BezierPath conversion
This avoids forcing the existing fair-spline solver into B-spline semantics and avoids reducing CAD geometry to a rendering-only Bezier chain.
The package intentionally excludes:
Those responsibilities stay in host applications. samples/DemoSpline is the
interactive fair-spline host, while samples/GlobalBSplineSample is a focused
headless example of the CAD-oriented API.
Spline.CP interpolation pointsSplineSolve()ComputeCurvatureBlending()Render() or RenderSvg()GlobalBSpline.Interpolate or InterpolateDetailedDegree, ControlPoints, Knots, and Weights for CAD geometryBSplineCurve.Evaluate() or EvaluateDerivative()BezierPath/SVG only at the rendering boundary when needed