Class: Coords

Coords(parentopt)

Class representing a 3D coordinate system.

Constructor

new Coords(parentopt)

Parameters:
Name Type Attributes Default Description
parent Coords <optional>
null
Source:

Classes

Coords

Members

dv :number

Nominal step-count for parametric curves and surfaces.
Type:
  • number
Source:

Methods

dupe() → {this}

Get a new duplicate transformed Coords object.
Source:
Returns:
Type
this

orient(v) → {Array.<number>}

Apply current un-translated coordinate transform to vector v.
Parameters:
Name Type Description
v Array.<number>
Source:
Returns:
Type
Array.<number>

quaternion(q) → {this}

Rotate by a quaternion
Parameters:
Name Type Description
q Array.<number> a quaternion
Source:
Returns:
Type
this

resetTransform() → {this}

Source:
Returns:
Type
this

rotate(angleopt, axisopt) → {this}

Parameters:
Name Type Attributes Default Description
angle number <optional>
0
axis number | Array.<number> <optional>
0 either an axis index (0, 1, 2) or an axis vector
Source:
Returns:
Type
this

rotateTo(srcAxis, dstAxis)

Rotate so that srcAxis goes into dstAxis.
Parameters:
Name Type Description
srcAxis Array.<number>
dstAxis Array.<number>
Source:

scale(sopt) → {this}

Parameters:
Name Type Attributes Default Description
s number <optional>
1
Source:
Returns:
Type
this

stretch(xopt, yopt, zopt) → {this}

Parameters:
Name Type Attributes Default Description
x number <optional>
1
y number <optional>
1
z number <optional>
1
Source:
Returns:
Type
this

transform(v) → {Array.<number>}

Apply current coordinate transform to vector v.
Parameters:
Name Type Description
v Array.<number>
Source:
Returns:
Type
Array.<number>

translate(xopt, yopt, zopt) → {this}

Parameters:
Name Type Attributes Default Description
x number <optional>
0
y number <optional>
0
z number <optional>
0
Source:
Returns:
Type
this