Skip to content

Vibe coding a plugin? Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

Transformation

An immutable affine transformation. a.multiply(b) applies b first, then a. Multiplying a point includes the translation; multiplying a vector doesn’t.

new Transformation(): Transformation

Creates the identity transformation.

Transformation

readonly origin: Point3d

Where the transformation moves the origin.


readonly xAxis: Vector3d

Where the transformation maps the X axis, including any scale.


readonly yAxis: Vector3d


readonly zAxis: Vector3d

equals(other): boolean

Exact matrix equality.

Transformation

boolean


inverse(): Transformation

The inverse transformation. Throws RangeError when there is none.

Transformation


multiply(other): Transformation

Composes transformations, or transforms a point or vector.

Transformation

Transformation

multiply(point): Point3d

Composes transformations, or transforms a point or vector.

Point3d

Point3d

multiply(vector): Vector3d

Composes transformations, or transforms a point or vector.

Vector3d

Vector3d


toArray(): number[]

The twelve numbers of the matrix, row by row: each row’s three axis components, then its translation.

number[]


toJSON(): number[]

JSON.stringify writes the twelve numbers of toArray.

number[]


static axes(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.

Point3dLike

Vector3dLike

Vector3dLike

Vector3dLike

Transformation


static rotation(origin, axis, angle): Transformation

A rotation by angle radians about axis through origin.

Point3dLike

Vector3dLike

number

Transformation


static scaling(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.

number | Vector3dLike

Point3dLike

Transformation


static translation(vector): Transformation

A translation by vector.

Vector3dLike

Transformation