ZLab.Discrete ZLab.Discrete
ZLab.Discrete ZLab.Discrete
Developed by Zeke Zhang

Search Results for

    Edit this page

    Struct BBox

    Axis-aligned bounding box (AABB) in 3D space.

    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: ZLab.Discrete.Geometry
    Assembly: ZLab.Discrete.dll
    Syntax
    public struct BBox

    Constructors

    Name Description
    BBox()

    Creates an empty bounding box. The box is degenerate until expanded.

    BBox(Vector3, Vector3)

    Creates a bounding box from minimum and maximum corner points.

    Fields

    Name Description
    Max

    Maximum corner of the bounding box.

    Min

    Minimum corner of the bounding box.

    Properties

    Name Description
    Center

    Center point of the bounding box.

    Empty

    An empty bounding box (degenerate). Use Expand() to grow it.

    Infinite

    An infinite bounding box.

    IsValid

    Checks if the bounding box is valid (not degenerate).

    Size

    Cartesian dimension of the bounding box. (Width, Height, Depth)

    SurfaceArea

    Surface area of the box (2*(xy + yz + zx)). Returns 0 for invalid boxes.

    Methods

    Name Description
    Contains(Vector3)

    Checks if a point is contained within the bounding box.

    Contains(BBox)

    Checks if another bounding box is fully contained within this bounding box.

    Equals(object?)

    Checks if two bounding boxes are equal (same min and max).

    Expand(Vector3)

    Expands the bounding box to include a point.

    Expand(BBox)

    Expands the bounding box to include another bounding box.

    FromUnordered(Vector3, Vector3)

    Create a box from possibly unordered corners by normalizing per axis.

    GetAllCorners(Span<Vector3>)

    Write all 8 corners to a Span (length >= 8). Order: (x,y,z)

    GetHashCode()

    Generates a hash code for the bounding box.

    Intersects(BBox)

    Checks if this bounding box intersects with another bounding box.

    Pad(float)

    Uniformly pad the box by a non-negative margin.

    ToMesh(CordSystem)

    Converts the bounding box to a mesh representation (12 triangles, 8 vertices). Winding is CCW for RightHanded; flipped for LeftHanded.

    ToString()

    String representation of the bounding box.

    Operators

    Name Description
    operator ==(BBox, BBox)

    Checks if two bounding boxes are equal (same min and max).

    operator !=(BBox, BBox)

    Checks if two bounding boxes are not equal.