bbox.ofFlat

The smallest axis-aligned box containing every finite point of a flat position array.

Value helperSince 0.3.0

Usage

TypeScript
BBox.ofFlat(flat: ArrayLike<number>): BBox

Parameters

  • flatArrayLike<number>

    Positions packed as [x0, y0, z0, x1, …] (a Float64Array, a plain array or the raw tier’s output). Required. In model.

Returns

The box of the points; BBox.empty when there are none or none is finite.

Example

TypeScript
BBox.ofFlat([0, 0, 0, 2, NaN, 0, 1, 3, -1]) // → { min: { x: 0, y: 0, z: -1 }, max: { x: 1, y: 3, z: 0 } }

See also