SplinePathBuilder Class

SplinePathBuilder class

The SplinePathBuilder class is designed to construct a smooth path by transforming Centripetal Catmull–Rom splines into Bezier curves. It offers a method to generate a path that smoothly interpolates through a set of points, providing a balance between fidelity to the points and smoothness of the curve.

public class SplinePathBuilder : IPathBuilder

Constructors

NameDescription
SplinePathBuilder()Initializes a new instance of the SplinePathBuilder class.
SplinePathBuilder(float)Initializes a new instance of the SplinePathBuilder class.
SplinePathBuilder(IImageTraceSmoother, IImageTraceSimplifier, float)Initializes a new instance of the SplinePathBuilder class.

Properties

NameDescription
Tension { get; set; }The value of the tensions affects how sharply the curve bends at the (interpolated) control points. It must be in the range from 0 to 1. Any higher or lower values will be aligned with the minimum and maximum values of this range, accordingly.
TraceSimplifier { get; set; }Gets or sets the trace simplifier.
TraceSmoother { get; set; }Gets or sets the trace smoother.

Methods

NameDescription
Build(IEnumerable<PointF>)Constructs a smooth path through a sequence of points by converting Centripetal Catmull–Rom splines into Bezier curves. This method ensures a natural and smooth transition through each point, creating an SVG path that closely follows the provided trace.

See Also