Show / Hide Table of Contents

    Class BoundingBox3D

    The BoundingBox3D class represents the axis-aligned area enclosed by a two points in 3D space.

    Inheritance
    object
    BoundingBox3D
    Inherited Members
    object.GetType()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: DesignData.SDS2.Primitives
    Assembly: DesignData.SDS2.Primitives.dll
    Syntax
    public sealed class BoundingBox3D

    Constructors

    BoundingBox3D(BoundingBox3D)

    Instantiates a bounding box as a copy of another bounding box.

    Declaration
    public BoundingBox3D(BoundingBox3D other)
    Parameters
    Type Name Description
    BoundingBox3D other

    BoundingBox3D(Point3D, Point3D)

    Instantiates a bounding box that contains both points

    Declaration
    public BoundingBox3D(Point3D p, Point3D q)
    Parameters
    Type Name Description
    Point3D p
    Point3D q

    Properties

    Depth

    The difference bewteen the maximum Z and minimum Z

    Declaration
    public double Depth { get; }
    Property Value
    Type Description
    double

    Height

    The difference bewteen the maximum Y and minimum Y

    Declaration
    public double Height { get; }
    Property Value
    Type Description
    double

    Max

    The maximum X, Y, and Z-coordinate of the bounds

    Declaration
    public Point3D Max { get; }
    Property Value
    Type Description
    Point3D

    MaxX

    The maximum X-coordinate of the bounds

    Declaration
    public double MaxX { get; }
    Property Value
    Type Description
    double

    MaxY

    The maximum Y-coordinate of the bounds

    Declaration
    public double MaxY { get; }
    Property Value
    Type Description
    double

    MaxZ

    The maximum Z-coordinate of the bounds

    Declaration
    public double MaxZ { get; }
    Property Value
    Type Description
    double

    Min

    The minimum X, Y, and Z-coordinate of the bounds

    Declaration
    public Point3D Min { get; }
    Property Value
    Type Description
    Point3D

    MinX

    The minimum X-coordinate of the bounds

    Declaration
    public double MinX { get; }
    Property Value
    Type Description
    double

    MinY

    The minimum Y-coordinate of the bounds

    Declaration
    public double MinY { get; }
    Property Value
    Type Description
    double

    MinZ

    The minimum Z-coordinate of the bounds

    Declaration
    public double MinZ { get; }
    Property Value
    Type Description
    double

    Volume

    The volume of the bounds

    Declaration
    public double Volume { get; }
    Property Value
    Type Description
    double

    Width

    The difference bewteen the maximum X and minimum X

    Declaration
    public double Width { get; }
    Property Value
    Type Description
    double

    Methods

    DoesEnclose(Point3D)

    True iff the specified point is within bounds

    Declaration
    public bool DoesEnclose(Point3D point)
    Parameters
    Type Name Description
    Point3D point
    Returns
    Type Description
    bool

    DoesOverlap(BoundingBox3D)

    True iff the two bounds overlap

    Declaration
    public bool DoesOverlap(BoundingBox3D other)
    Parameters
    Type Name Description
    BoundingBox3D other
    Returns
    Type Description
    bool

    Equals(object)

    Checks to see if the Min and Max are equal using Double.Equals on each component. Note that this is an "exact" comparison method, and only appropriate in special circumstances.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The bounds to compare to

    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)

    Expanded(double)

    A new bounding box expanded on all sides by the specified amount

    Declaration
    public BoundingBox3D Expanded(double amount)
    Parameters
    Type Name Description
    double amount
    Returns
    Type Description
    BoundingBox3D

    ~BoundingBox3D()

    The BoundingBox3D class represents the axis-aligned area enclosed by a two points in 3D space.

    Declaration
    protected ~BoundingBox3D()

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    ShortestVectorToPoint(Point3D)

    The shortest vector from the bounds to the specified point

    Declaration
    public Vector3D ShortestVectorToPoint(Point3D point)
    Parameters
    Type Name Description
    Point3D point
    Returns
    Type Description
    Vector3D

    ToString()

    Formats the point into a string. Note that because the values are rounded for display, parsing them to retrieve the Min and Max values will not necessarily yield the same bounds.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Unioned(Point3D)

    A new bounding box that includes the current bounds and the specified point

    Declaration
    public BoundingBox3D Unioned(Point3D point)
    Parameters
    Type Name Description
    Point3D point
    Returns
    Type Description
    BoundingBox3D

    Operators

    operator ==(BoundingBox3D, BoundingBox3D)

    Checks on Min and Max. Note that this is an "exact" comparison method, and only appropriate in special circumstances.

    Declaration
    public static bool operator ==(BoundingBox3D a, BoundingBox3D b)
    Parameters
    Type Name Description
    BoundingBox3D a

    The bounds to compare

    BoundingBox3D b

    The bounds to compare to

    Returns
    Type Description
    bool

    operator !=(BoundingBox3D, BoundingBox3D)

    Checks inequality on Min and Max Note that this is an "exact" comparison method, and only appropriate in special circumstances.

    Declaration
    public static bool operator !=(BoundingBox3D a, BoundingBox3D b)
    Parameters
    Type Name Description
    BoundingBox3D a

    The bounds to compare

    BoundingBox3D b

    The bounds to compare to

    Returns
    Type Description
    bool
    Back to top