Class: DefCurveParam

algeobra~DefCurveParam()

Definition for a parameter of a point on a curve Will calculate the parameter, if the point lies on the curve. In some cases, there might me multiple possible parameters Supported curve objects are: Line, vector (treated as a line from reference to arrow tip), arc, line strip, Bezier, Bezier spline, ellipse

Constructor

new DefCurveParam()

Source:

Methods

compute(info) → {Array}

Computes the parameter on a curve
Parameters:
Name Type Description
info CreateInfo The creation info
Source:
Returns:
The t values of type TYPE_NUMBER
Type
Array

(static) arcParam(arc, p, eps) → {Array.<Number>}

Computes the parameter of a point on an arc.
Parameters:
Name Type Default Description
arc Object The arc object
p Object The point
eps Number 1e-10 The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) bezierParam(curve, p, eps) → {Array.<Number>}

Computes the parameter of a point on a Bezier curve.
Parameters:
Name Type Default Description
curve Object The curve object
p Object The point
eps Number 1e-10 The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) bezierSplineParam(spline, p, eps) → {Array.<Number>}

Computes the parameter of a point on a Bezier spline.
Parameters:
Name Type Default Description
spline Object The Bezier spline object
p Object The point
eps Number 1e-10 The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) curveParam(curve, p, eps) → {Array.<Number>}

Parameters:
Name Type Description
curve Object The curve object
p Object The point
eps Number The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) ellipseParam(ellipse, p, eps) → {Array.<Number>}

Computes the parameter of a point on an ellipse.
Parameters:
Name Type Default Description
ellipse Object The ellipse object
p Object The point
eps Number 1e-10 The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) fromCurve(curve, p, params) → {CreateInfo}

Computes the paramter of a point on a curve
Parameters:
Name Type Description
curve Number | Object Either the index or value of a curve object. The supported types are specified at the documention of this class
p Number | Object Either the index or value of a TYPE_POINT. The point
params Object
Properties
Name Type Attributes Description
takeIndex Number <optional>
The index of the parameter to use. If < 0, then the returned result will be used. If = 0, either the first entry in an parameter array or the parameter will be returned If > 0, the indicated index in an array of parameters If any requested parameter does not exist (for example requesting the second one, when only one exists) will result in INVALID
eps Number <optional>
The epsilon value used for comparisons
Source:
Returns:
The creation info
Type
CreateInfo

(static) lineParam(line, p, params) → {Array.<Number>}

Computes the parameter of a point on a line.
Parameters:
Name Type Description
line Object The line object
p Object The point
params Object
Properties
Name Type Attributes Description
eps Number <optional>
The epsilon value used for comparisons
minT Number <optional>
The minimum t value
maxT Number <optional>
The maximum t value
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) lineStripParam(lineStrip, p, eps) → {Array.<Number>}

Computes the parameter of a point on a line strip.
Parameters:
Name Type Default Description
lineStrip Object The line strip object
p Object The point
eps Number 1e-10 The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) polygonParam(poly, p, eps) → {Array.<Number>}

Computes the parameter of a point on a polygon.
Parameters:
Name Type Default Description
poly Object The polygon object
p Object The point
eps Number 1e-10 The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>

(static) vectorParam(v, p, eps) → {Array.<Number>}

Computes the parameter of a point on a vector. The vector is treated as a line segment from the reference to the arrow tip
Parameters:
Name Type Default Description
v Object The vector object
p Object The point
eps Number 1e-10 The epsilon value used for comparisons
Source:
Returns:
The possible t values
Type
Array.<Number>