Transformation
An immutable affine transformation. a.multiply(b) applies b first, then a.
Multiplying a point includes the translation; multiplying a vector doesn’t.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Transformation():
Transformation
Creates the identity transformation.
Returns
Section titled “Returns”Transformation
Properties
Section titled “Properties”origin
Section titled “origin”
readonlyorigin:Point3d
Where the transformation moves the origin.
readonlyxAxis:Vector3d
Where the transformation maps the X axis, including any scale.
readonlyyAxis:Vector3d
readonlyzAxis:Vector3d
Methods
Section titled “Methods”equals()
Section titled “equals()”equals(
other):boolean
Exact matrix equality.
Parameters
Section titled “Parameters”Transformation
Returns
Section titled “Returns”boolean
inverse()
Section titled “inverse()”inverse():
Transformation
The inverse transformation. Throws RangeError when there is none.
Returns
Section titled “Returns”Transformation
multiply()
Section titled “multiply()”Call Signature
Section titled “Call Signature”multiply(
other):Transformation
Composes transformations, or transforms a point or vector.
Parameters
Section titled “Parameters”Transformation
Returns
Section titled “Returns”Transformation
Call Signature
Section titled “Call Signature”multiply(
point):Point3d
Composes transformations, or transforms a point or vector.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”multiply(
vector):Vector3d
Composes transformations, or transforms a point or vector.
Parameters
Section titled “Parameters”vector
Section titled “vector”Returns
Section titled “Returns”toArray()
Section titled “toArray()”toArray():
number[]
The twelve numbers of the matrix, row by row: each row’s three axis components, then its translation.
Returns
Section titled “Returns”number[]
toJSON()
Section titled “toJSON()”toJSON():
number[]
JSON.stringify writes the twelve numbers of toArray.
Returns
Section titled “Returns”number[]
axes()
Section titled “axes()”
staticaxes(origin,xAxis,yAxis,zAxis):Transformation
Maps the unit axes to xAxis, yAxis and zAxis at origin, so local coordinates
become those of a frame. The axes must not lie in one plane; their lengths scale.
Parameters
Section titled “Parameters”origin
Section titled “origin”Returns
Section titled “Returns”Transformation
rotation()
Section titled “rotation()”
staticrotation(origin,axis,angle):Transformation
A rotation by angle radians about axis through origin.
Parameters
Section titled “Parameters”origin
Section titled “origin”number
Returns
Section titled “Returns”Transformation
scaling()
Section titled “scaling()”
staticscaling(factors,origin?):Transformation
A scale about origin, the model origin by default: uniform for one factor, or along X,
Y and Z for a vector of three. Negative factors mirror; a zero factor flattens, which
points and vectors accept but edits of the model reject.
Parameters
Section titled “Parameters”factors
Section titled “factors”number | Vector3dLike
origin?
Section titled “origin?”Returns
Section titled “Returns”Transformation
translation()
Section titled “translation()”
statictranslation(vector):Transformation
A translation by vector.
Parameters
Section titled “Parameters”vector
Section titled “vector”Returns
Section titled “Returns”Transformation