Class: DefBezierSpline

algeobra~DefBezierSpline(params)

Definition of a Bezier spline. A Bezier spline is specified by its control points and degree. It differs from a Bezier curve in that it is a sequence of connected curves. The last control point of each segment is the first control point of the next one

Constructor

new DefBezierSpline(params)

Default value
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
points Array.<{x:Number, y:Number}> <optional>
An array of control points
degree Number <optional>
The degree of the spline
Source:

Methods

compute(createInfo) → {Object}

Computes the Bezier spline
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
A Bezier spline of type TYPE_BEZIER_SPLINE
Type
Object

(static) fromCatmullRom(points) → {CreateInfo}

Computes a Catmull-Rom spline from an array of points. The curve will go through all points.
Parameters:
Name Type Description
points Array.<(Number|Object)> | Number | Array Either the indices or values of TYPE_POINT or the index of value of an array containing points. The points from which to make the Bezier spline of
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromPointArray(pointArray, attach) → {CreateInfo}

Computes a Bezier spline from an array of control points stored as a value
Parameters:
Name Type Default Description
pointArray Number | Object Either the index or value of an array of points of type TYPE_POINT. The point array
attach Boolean false Whether the points should be attached to the points already specified for this Bezier spline
Source:
Returns:
The creation info
Type
CreateInfo

(static) fromPoints(points, attach) → {CreateInfo}

Computes a Bezier spline from an array of control points
Parameters:
Name Type Default Description
points Array.<(Number|Object)> Either the indices or values of TYPE_POINT. The points from which to make the Bezier spline of
attach Boolean false Whether the points should be attached to the points already specified for this Bezier spline
Source:
Returns:
The creation info
Type
CreateInfo