Class: DefCurvePoint

algeobra~DefCurvePoint(topt)

Definition for a point on a curve Will calculate the point given a parameter Supported curve objects are: Line, vector (treated as a line from reference to arrow tip), arc, line strip, Bezier, Bezier spline, ellipse

Constructor

new DefCurvePoint(topt)

Default values
Parameters:
Name Type Attributes Default Description
t Number <optional>
0 The t value
Source:

Methods

compute(createInfo) → {Object}

Computes the curve point
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
An object of type TYPE_POINT
Type
Object

(static) bezierPoint(points, t) → {Object}

Computes the point on a Bezier curve.
Parameters:
Name Type Description
points Object The control points
t Number The curve parameter
Source:
Returns:
The resulting point
Type
Object

(static) bezierSplinePoint(points, degree, t) → {Object}

Computes the point on a Bezier spline.
Parameters:
Name Type Description
points Object The control points
degree Number The spline degree
t Number The curve parameter
Source:
Returns:
The resulting point
Type
Object

(static) circlePoint(center, r, alpha) → {Object}

Computes the point on a circle.
Parameters:
Name Type Description
center Object The circle center
r Number The circle radius
alpha Number The angle
Source:
Returns:
The resulting point
Type
Object

(static) curvePoint(obj, t) → {Object}

Computes the point on a curve. Supported types are documented at the top of this class
Parameters:
Name Type Description
obj Object The curve object
t Number The curve parameter
Source:
Returns:
The resulting point
Type
Object

(static) ellipsePoint(center, rx, ry, rotation, alpha) → {Object}

Computes the point on a ellipse.
Parameters:
Name Type Description
center Object The ellipse center
rx Number The ellipse x-eccentricity
ry Number The ellipse y-eccentricity
rotation Number The ellipse rotation
alpha Number The angle
Source:
Returns:
The resulting point
Type
Object

(static) fromCurve(obj, topt) → {CreateInfo}

Computes the point on a curve
Parameters:
Name Type Attributes Description
obj Number | Object Either the index or value of a curve object. The supported types are specified at the documention of this class
t Number | Object <optional>
Either the index or value of a TYPE_NUMBER. The curve parameter
Source:
Returns:
The creation info
Type
CreateInfo

(static) linePoint(p0, p1, t) → {Object}

Computes the point on a line.
Parameters:
Name Type Description
p0 Object The first line point
p1 Object The second line point
t Number The curve parameter
Source:
Returns:
The resulting point
Type
Object

(static) lineStripPoint(points, t) → {Object}

Computes the point on a line strip.
Parameters:
Name Type Description
points Object The line strip points
t Number The curve parameter
Source:
Returns:
The resulting point
Type
Object

(static) polygonPoint(points, t) → {Object}

Computes the point on a polygon.
Parameters:
Name Type Description
points Object The polygon points
t Number The curve parameter
Source:
Returns:
The resulting point
Type
Object

(static) vectorPoint(v, t) → {Object}

Computes the point on a vector. The vector is treated as a line segment from the reference to the arrow tip
Parameters:
Name Type Description
v Object The vector of type TYPE_VECTOR
t Number The curve parameter
Source:
Returns:
The resulting point
Type
Object