bbox.center

The centre point of a box.

Value helperSince 0.3.0

Usage

TypeScript
BBox.center(b: BBox): Point3

Parameters

  • bBBox

    The box. Required. In model.

Returns

The midpoint of min and max; NaN coordinates for an empty box (check BBox.isEmpty first).

Example

TypeScript
BBox.center(BBox.ofPoints([Point3.origin, Point3.of(2, 4, 6)])) // → { x: 1, y: 2, z: 3 }

See also