region2.rings

Every ring of the region: each part’s outline, then its holes.

Value helperSince 0.4.0

Usage

TypeScript
region.rings(): Polygon2[]

Returns

A new array of the rings, outlines counter-clockwise and holes clockwise; [] for Region2.empty.

Example

TypeScript
Region2.of(Polygon2.rectangle(4, 4).value, [Polygon2.rectangle(2, 2).value]).rings().map((r) => r.signedArea()) // → [16, -4]

See also