Class SplinePathBuilder

Class SplinePathBuilder

Namespace: Aspose.Svg.ImageVectorization
Assembly: Aspose.SVG.dll (25.5.0)

The Aspose.Svg.ImageVectorization.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.

[ComVisible(true)]
public class SplinePathBuilder : IPathBuilder

Inheritance

object SplinePathBuilder

Implements

IPathBuilder

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

SplinePathBuilder()

Initializes a new instance of the Aspose.Svg.ImageVectorization.SplinePathBuilder class.

public SplinePathBuilder()

SplinePathBuilder(float)

Initializes a new instance of the Aspose.Svg.ImageVectorization.SplinePathBuilder class.

public SplinePathBuilder(float tension)

Parameters

tension float

The tension.

SplinePathBuilder(IImageTraceSmoother, IImageTraceSimplifier, float)

Initializes a new instance of the Aspose.Svg.ImageVectorization.SplinePathBuilder class.

public SplinePathBuilder(IImageTraceSmoother traceSmoother, IImageTraceSimplifier traceSimplifier, float tension)

Parameters

traceSmoother IImageTraceSmoother

The trace smoother.

traceSimplifier IImageTraceSimplifier

The trace simplifier.

tension float

The tension.

Properties

Tension

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.

public float Tension { get; set; }

Property Value

float

TraceSimplifier

Gets or sets the trace simplifier.

public IImageTraceSimplifier TraceSimplifier { get; set; }

Property Value

IImageTraceSimplifier

TraceSmoother

Gets or sets the trace smoother.

public IImageTraceSmoother TraceSmoother { get; set; }

Property Value

IImageTraceSmoother

Methods

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.

public string Build(IEnumerable<pointf> trace)

Parameters

trace IEnumerable < PointF &gt;

The sequence of points to be interpolated into a smooth path.

Returns

string

A string representing the SVG path data, comprising Bezier curve commands and coordinates that approximate the Centripetal Catmull–Rom spline. </pointf>

 English