bbox.union

The smallest box containing both boxes.

Value helperSince 0.3.0

Usage

TypeScript
BBox.union(a: BBox, b: BBox): BBox

Parameters

  • aBBox

    First box. Required. In model.

  • bBBox

    Second box. Required. In model.

Returns

The enclosing box; the other argument itself when one is empty, and BBox.empty when both are.

Example

TypeScript
BBox.union(BBox.ofPoints([Point3.origin]), BBox.ofPoints([Point3.of(1, 1, 1)])) // → { min: { x: 0, y: 0, z: 0 }, max: { x: 1, y: 1, z: 1 } }

See also