The class representing an axis-aligned bounding box (AABB) in 3d space.

Constructors

  • Create a 3d box bounded by min and max.

    Parameters

    • min: undefined | AcGeVector3dLike = undefined

      (optional) Input the lower (x, y, z) boundary of the box. Set it to ( + Infinity, + Infinity, + Infinity ) if undefined or null provided.

    • max: undefined | AcGeVector3dLike = undefined

      (optional) Input the upper (x, y, z) boundary of the box. Set it to ( - Infinity, - Infinity, - Infinity ) if undefined or null provided.

    Returns AcGeBox3d

Properties

The upper (x, y, z) boundary of the box.

The lower (x, y, z) boundary of the box.

Accessors

Methods

  • Return true if this box includes the entirety of box. If this and box are identical, this function also returns true.

    Parameters

    • box: AcGeBox3d

      Input 3d box to test for inclusion.

    Returns boolean

    Return true if this box includes the entirety of box.

  • Return true if the specified point lies within or on the boundaries of this box.

    Parameters

    Returns boolean

    Return true if the specified point lies within or on the boundaries of this box.

  • Returns the distance from any edge of this box to the specified point. If the point lies inside of this box, the distance will be 0.

    Parameters

    Returns number

    Return the distance from any edge of this box to the specified point.

  • Return true if this box and box share the same lower and upper bounds.

    Parameters

    • box: AcGeBox3d

      Input box to compare with this one.

    Returns boolean

    Return true if this box and box share the same lower and upper bounds.

  • Expand each dimension of the box by scalar. If negative, the dimensions of the box will be contracted.

    Parameters

    • scalar: number

      Input distance to expand the box by.

    Returns AcGeBox3d

    Return this box

  • Expand this box equilaterally by vector. The width of this box will be expanded by the x component of vector in both directions. The height of this box will be expanded by the y component of vector in both directions. The depth of this box will be expanded by the z component of vector in both directions.

    Parameters

    Returns AcGeBox3d

    Return this box

  • Compute the intersection of this and box, setting the upper bound of this box to the lesser of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' lower bounds. If there's no overlap, makes this box empty.

    Parameters

    • box: AcGeBox3d

      Input 3d box to intersect with.

    Returns AcGeBox3d

    Return this box

  • Determine whether or not this box intersects box.

    Parameters

    • box: AcGeBox3d

      Input 3d box to check for intersection against.

    Returns boolean

    Return true if this box intersects the specified box.

  • Determine whether or not this box intersects plane.

    Parameters

    • plane: AcGePlane

      Input the plane to check for intersection against.

    Returns boolean

    Return true if this box intersects the specified plane.

  • Return true if this box includes zero points within its bounds. Note that a box with equal lower and upper bounds still includes one point, the one both bounds share.

    Returns boolean

    Return true if this box includes zero points within its bounds.

  • Set the upper and lower bounds of this box to include all of the data in array.

    Parameters

    • array: number[]

      Input an array of position data that the resulting box will envelop.

    Returns AcGeBox3d

    Return this box

  • Compute the union of this box and box, setting the upper bound of this box to the greater of the two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' lower bounds.

    Parameters

    • box: AcGeBox3d

      Input the 3d box that will be unioned with this box.

    Returns AcGeBox3d

    Return this box