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

Constructors

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

    Parameters

    • Optionalmin: AcGeVector3dLike

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

    • Optionalmax: AcGeVector3dLike

      (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

  • get center(): AcGeVector3d
  • Center point of this box

    Returns AcGeVector3d

  • get size(): AcGeVector3d
  • Return the width, height and depth of this box.

    Returns AcGeVector3d

Methods

  • Transform this box with the supplied matrix.

    Parameters

    Returns this

    Return this box

  • Return a new box with the same min and max as this one.

    Returns AcGeBox3d

    Return a new box with the same min and max as this one.

  • 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.

  • Copy the min and max from box to this box.

    Parameters

    Returns this

    Return 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 the boundaries of this box to include point.

    Parameters

    Returns this

  • 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 this

    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 this

    Return this box

  • Return the center point of the box as a 3d vector.

    Parameters

    • target: AcGeVector3d

      Input the result copied into this 3d vector.

    Returns AcGeVector3d

    Return the center point of the box

  • Return the width, height and depth of this box.

    Parameters

    • target: AcGeVector3d

      Return the result copied into this 3d vector.

    Returns AcGeVector3d

    Return the width, height and depth of 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 this

    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.

  • Make this box empty.

    Returns this

    Return this box

  • Set the lower and upper (x, y, z) boundaries of this box. Please note that this method only copies the values from the given objects.

    Parameters

    Returns this

    Return this box.

  • 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 this

    Return this box

  • Center this box on center and set this box's width, height and depth to the values specified in size

    Parameters

    Returns this

    Return this box

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

    Parameters

    • points: AcGeVector3dLike[]

      Input an array of 3d point or 3d vector that the resulting box will contain.

    Returns this

    Return this box

  • Add offset to both the upper and lower bounds of this box, effectively moving this box offset units in 3d space.

    Parameters

    Returns this

    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 this

    Return this box