Spline is the NuGet package published from this repository. It exposes the
reusable spline engine without bringing the Avalonia UI layer along with it.
SplineSpline.dllSplineThe package, assembly, and public namespace are aligned as Spline. Because
the namespace and the main spline type now share the same identifier, an alias
such as using SplinePath = global::Spline.Spline; keeps consumer code clear.
Vec2BezierPath and CubicBezierSpline, TwoParamCurve, and TwoParamSplineCurveGrid and TwoCubicsPolylineUtilsThe package is built from src/Spline/Spline.csproj and includes both a
NuGet package and a symbol package during dotnet pack.
using Spline;
using SplinePath = global::Spline.Spline;
var controlPoints = new[]
{
new SplinePath.CP(new Vec2(0, 0), "corner", null, null),
new SplinePath.CP(new Vec2(60, 20), "smooth", null, null),
new SplinePath.CP(new Vec2(120, 0), "corner", null, null),
};
var spline = new SplinePath(controlPoints, isClosed: false);
spline.Solve();
spline.ComputeCurvatureBlending();
BezierPath path = spline.Render();
string svg = path.ToSvgPath();
Reach for samples/DemoSpline when you need:
CurveGrid and TwoCubics