pub struct Spline {
    pub points: Vec<PointF64>,
}
Expand description

Series of connecting 2D Bezier Curves

Fields

points: Vec<PointF64>

1+3*(num_curves) points, where the first curve is represented by the first 4 points and each subsequent curve is represented by the last point in the previous curve plus 3 points Points are of PointF64 type.

Implementations

Creates an empty spline defined by a starting point

Adds a curve to the end of the spline. Takes 3 points that are the second to fourth control points of the bezier curve. Note that the first control point is taken from the last point of the previous curve.

Returns an iterator on the vector of points on the spline

Returns the number of points on the spline

Returns the number of curves on the spline

Returns true if the spline contains no curve, false otherwise A curve is defined by 4 points, so a non-empty spline should contain at least 4 points.

Applies an offset to all points on the spline

Returns a spline created from image. The following steps are performed:

  1. Convert pixels into path
  2. Simplify the path into polygon
  3. Smoothen the polygon and approximate it with a curve-fitter

Corner/Splice thresholds are specified in radians. Length threshold is specified in pixels (length unit in path coordinate system).

Returns a spline by curve-fitting a path.

Splice threshold is specified in radians.

Converts spline to svg path. Panic if the length of spline is not valid (not 1+3n for some integer n)

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.