BoundingBox

verb.core.BoundingBox

CLASS

Source code

BoundingBox is an n-dimensional bounding box implementation. It is used by many of verb's intersection algorithms.

The first point added to the BoundingBox using BoundingBox.add will be used to define the dimensionality of the bounding box.

constructor

METHOD

Source code

new BoundingBox(pts : Array<Point>)

BoundingBox Constructor

params

fromPoint

METHOD

Source code

fromPoint(pt : undefined)

Create a bounding box initialized with a single element

params

returns

add

METHOD

Source code

add(point : Point) : BoundingBox

Adds a point to the bounding box, expanding the bounding box if the point is outside of it. If the bounding box is not initialized, this method has that side effect.

params

returns

addRange

METHOD

Source code

addRange(points : Array<Point>) : BoundingBox

Asynchronously add an array of points to the bounding box

params

returns

contains

METHOD

Source code

contains(point : Point, tol : Float) : Bool

Determines if point is contained in the bounding box

params

returns

intervalsOverlap

STATIC METHOD

Source code

intervalsOverlap(a1 : Float, a2 : Float, b1 : Float, b2 : Float, tol : Float) : Bool

Determines if two intervals on the real number line intersect

params

returns

intersects

METHOD

Source code

intersects(bb : BoundingBox, tol : Float) : Bool

Determines if this bounding box intersects with another

params

returns

clear

METHOD

Source code

clear() : BoundingBox

Clear the bounding box, leaving it in an uninitialized state. Call add, addRange in order to initialize

returns

getLongestAxis

METHOD

Source code

getLongestAxis() : Int

Get longest axis of bounding box

returns

getAxisLength

METHOD

Source code

getAxisLength(i : Int) : Float

Get length of given axis.

params

returns

intersect

METHOD

Source code

intersect(bb : BoundingBox, tol : Float) : BoundingBox

Compute the boolean intersection of this with another axis-aligned bounding box. If the two bounding boxes do not intersect, returns null.

params

returns

min

PROPERTY

Source code

min : Point

The minimum point of the BoundingBox - the coordinates of this point are always <= max.

max

PROPERTY

Source code

max : Point

The maximum point of the BoundingBox. The coordinates of this point are always >= min.