bbox.contains

Whether a point lies inside a box or on its boundary.

Value helperSince 0.3.0

Usage

TypeScript
BBox.contains(b: BBox, p: Point3): boolean

Parameters

  • bBBox

    The box. Required. In model.

  • pPoint3

    The point to test. Required. In model.

Returns

true when min ≤ p ≤ max on every axis; false for an empty box or a NaN coordinate.

Example

TypeScript
BBox.contains(BBox.ofPoints([Point3.origin, Point3.of(1, 1, 1)]), Point3.of(1, 0.5, 0)) // → true

See also