polygon2.transformed

The polygon with a transform applied, as if lying in the z = 0 plane.

Value helperSince 0.4.0

Usage

TypeScript
polygon.transformed(xf: Transform): Polygon2

Parameters

  • xfTransform

    The transform, column-major.

    Required

Returns

A new polygon of the transformed corners with z dropped. A mirror reverses its winding.

Example

TypeScript
Polygon2.rectangle(2, 2).value.transformed(Transform.translation(Vector3.of(5, 0, 0))).points()[0] // → { x: 4, y: -1 }

See also