transform.scale

The transform that scales uniformly or per axis about a centre point.

Value helperSince 0.3.0

Usage

TypeScript
Transform.scale(s: number | Vector3, center?: Point3): Transform

Parameters

  • snumber | Vector3

    One factor for all axes, or a factor per axis as { x, y, z }. Negative factors mirror; 0 flattens.

    Required

  • centerPoint3

    The fixed point of the operation. Default Point3.origin. In model.

Returns

A frozen transform that leaves center fixed. A zero factor gives a singular transform; it is not rejected.

Example

TypeScript
Transform.applyToPoint(Transform.scale(2, Point3.of(1, 1, 1)), Point3.of(2, 1, 1)) // → { x: 3, y: 1, z: 1 }

See also