BBox Type
A struct of 6 floats representing an immutable 3D bounding box. This implementation guarantees the box to always be valid. That means the Min X, Y, and Z values are always smaller or equal to the respective Max values. The X, Y, and Z axes are also called Width, Depth, and Height3D.
Z-Axis Y-Axis
^ /
| 7 / 6 MaxPt
| +---------------+
| /| / /|
| / | / / |
4 |/ | / 5 / |
+---------------+ |
| |/ | |
| +-----------|---+
| / 3 | / 2
| / | /
|/ |/
+---------------+----> X-Axis
0 MinPt 1
Record fields
| Record Field |
Description
|
Full Usage:
MaxX
Field type: float
|
The fields holding the maximum X value of this 3D bounding box.
|
Full Usage:
MaxY
Field type: float
|
The fields holding the maximum Y value of this 3D bounding box.
|
Full Usage:
MaxZ
Field type: float
|
The fields holding the maximum Z value of this 3D bounding box.
|
Full Usage:
MinX
Field type: float
|
The fields holding the minimum X value of this 3D bounding box.
|
Full Usage:
MinY
Field type: float
|
The fields holding the minimum Y value of this 3D bounding box.
|
Full Usage:
MinZ
Field type: float
|
The fields holding the minimum Z value of this 3D bounding box.
|
Instance members
| Instance member |
Description
|
|
Returns the 2D part of this 3D bounding box as a bounding rectangle (BRect).
|
Full Usage:
this.AsFSharpCode
Returns: string
|
Format bounding box into an F# code string that can be used to recreate the bounding box.
|
Full Usage:
this.AsString
Returns: string
|
Format bounding box into string with nice floating point number formatting of size and position. But without full type name as in bbox.ToString()
|
|
Returns the bottom of the box as a Counter-Clockwise array of 4 Points. Starting at MinPt. Points 0, 1, 2, and 3. Last and first point are NOT the same.
|
|
Returns the bottom of the box as a Counter-Clockwise array of 5 Points, starting at MinPt. Points 0, 1, 2, 3, and again 0. Last and first point are the same.
|
|
The center of this 3D bounding box.
|
|
Returns TRUE if this 3D bounding box is inside or exactly on the other bounding Box.
|
|
|
Full Usage:
this.ContainsXYZ
Parameters:
float
y : float
z : float
Returns: bool
Modifiers: inline |
Returns TRUE if the point is inside or exactly on the bounding Box.
|
Full Usage:
this.CountZeroSides
Returns: int
Modifiers: inline |
Counts the amount of sides that are smaller than the zeroLength tolerance. This is 0, 1, 2 or 3.
|
|
The diagonal 3D vector of this 3D bounding box. From MinPnt to MaxPnt.
|
|
Returns the X-aligned edge from point 0 to 1.
|
|
Returns the Y-aligned edge from point 0 to 3.
|
|
Returns the Z-aligned edge from point 0 to 4.
|
|
Returns the Y-aligned edge from point 1 to 2.
|
|
Returns the Z-aligned edge from point 1 to 5.
|
|
Returns the Z-aligned edge from point 2 to 6.
|
|
Returns the X-aligned edge from point 3 to 2.
|
|
Returns the Z-aligned edge from point 3 to 7.
|
|
Returns the X-aligned edge from point 4 to 5.
|
|
Returns the Y-aligned edge from point 4 to 7.
|
|
Returns the Y-aligned edge from point 5 to 6.
|
|
Returns the X-aligned edge from point 7 to 6.
|
|
Returns the 12 edges of this 3D bounding box as an array of 12 Lines. Pairs in this order: 0-1, 1-2, 3-2, 0-3, 0-4, 1-5, 2-6, 3-7, 4-5, 5-6, 7-6, 4-7
|
Full Usage:
this.EvaluateAt
Parameters:
float
yParameter : float
zParameter : float
Returns: Pnt
Modifiers: inline |
Evaluate a X, Y and Z parameter of this 3D bounding box. 0.0, 0.0, 0.0 returns the MinPnt. 1.0, 1.0, 1.0 returns the MaxPnt.
|
Full Usage:
this.Expand
Parameters:
float
yDist : float
zDist : float
Returns: BBox
Modifiers: inline |
Returns a 3D bounding box expanded by a distance for X, Y, and Z-axis each. Does check for underflow if distance is negative and raises EuclidException.
|
|
Returns a 3D bounding box expanded by distance. Does check for underflow if distance is negative and raises EuclidException.
|
|
Returns a 3D bounding box expanded by a distance. If expansion is negative it shrinks the Box without causing underflow. When the negative expansion is bigger than the size on any axis, both Min and Max values on that axis will be set to the midpoint of their original values (the box collapses to a plane or line on that axis).
|
Full Usage:
this.ExpandSafe
Parameters:
float
yDist : float
zDist : float
Returns: BBox
Modifiers: inline |
Returns a 3D bounding box expanded by a distance for X, Y, and Z-axis each. If expansion is negative it shrinks the Box without causing underflow. When the negative expansion is bigger than the size on any axis, both Min and Max values on that axis will be set to the midpoint of their original values (the box collapses to a plane or line on that axis).
|
Full Usage:
this.ExpandXaxis
Parameters:
float
endDist : float
Returns: BBox
Modifiers: inline |
Returns a 3D bounding box expanded only in X direction by different distances for start(minX) and end (maxX). Does check for underflow if distance is negative and raises EuclidException.
|
Full Usage:
this.ExpandYaxis
Parameters:
float
endDist : float
Returns: BBox
Modifiers: inline |
Returns a 3D bounding box expanded only in Y direction by different distances for start(minY) and end (maxY). Does check for underflow if distance is negative and raises EuclidException.
|
Full Usage:
this.ExpandZaxis
Parameters:
float
endDist : float
Returns: BBox
Modifiers: inline |
Returns a 3D bounding box expanded only in Z direction by different distances for start(minZ) and end (maxZ). Does check for underflow if distance is negative and raises EuclidException.
|
Full Usage:
this.HasVolume
Returns: bool
Modifiers: inline |
Tests if none of the X, Y and Z axis is smaller than the zeroLength tolerance. Same as .IsValid
|
|
Returns the intersection of two 3D bounding boxes. The returned BBox is the volume that is inside both input 3D bounding boxes. Returns ValueNone if the two 3D bounding boxes do not overlap. Just touching 3D bounding boxes will return ValueSome with a zero volume collapsed BBox.
|
Full Usage:
this.IsFlat
Returns: bool
Modifiers: inline |
Tests if one of the X, Y and Z axis is smaller than the zeroLength tolerance.
|
Full Usage:
this.IsLine
Returns: bool
Modifiers: inline |
Tests if two of the X, Y and Z axis is smaller than the zeroLength tolerance.
|
|
Returns TRUE if the two 3D bounding boxes do overlap or touch exactly. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other. Use .IsOverlappingOrClose if you want to specify a tolerance for near misses.
|
Full Usage:
this.IsOverlappingOrClose
Parameters:
BBox
tolerance : float
Returns: bool
Modifiers: inline |
Returns TRUE if the two 3D bounding boxes do overlap or are apart less than the specified tolerance. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other. A negative tolerance shrinks the effective boundaries instead of expanding them.
|
Full Usage:
this.IsPoint
Returns: bool
Modifiers: inline |
Tests if all sides are smaller than the zeroLength tolerance. This is the same as IsZero.
|
Full Usage:
this.IsTouching
Parameters:
BBox
?tolerance : float
Returns: bool
Modifiers: inline |
Returns TRUE if the two 3D bounding boxes are just touching. The default tolerance is 1e-6.But can also be specified as a parameter. Returns FALSE if one box is completely inside the other. Returns FALSE if one box is completely surrounding the other.
|
Full Usage:
this.IsValid
Returns: bool
Modifiers: inline |
Tests if no sides of the X, Y and Z axis is smaller than the zeroLength tolerance. Same as .HasVolume
|
Full Usage:
this.IsZero
Returns: bool
Modifiers: inline |
Tests if all sides are smaller than the zeroLength tolerance. This is the same as IsPoint.
|
Full Usage:
this.LongestEdge
Returns: float
Modifiers: inline |
Returns the longest edge of the Box.
|
|
The point where X, Y, and Z are the maximum values.
|
|
The point where X, Y, and Z are the minimum values.
|
|
Returns the bottom corners of this 3D bounding box in Counter-Clockwise order, starting at MinPt. Then the top corners starting above MinPt. Returns an array of 8 Points.
|
Returns point 0 of this 3D bounding box, same as member box.MinPnt.
|
|
Returns point 1 of this 3D bounding box.
|
|
Returns point 2 of this 3D bounding box.
|
|
Returns point 3 of this 3D bounding box.
|
|
Returns point 4 of this 3D bounding box.
|
|
Returns point 5 of this 3D bounding box.
|
|
Returns point 6 of this 3D bounding box.
|
|
Returns point 7 of this 3D bounding box.
|
|
Full Usage:
this.ShortestEdge
Returns: float
Modifiers: inline |
Returns the shortest edge of the Box.
|
Full Usage:
this.SizeX
Returns: float
Modifiers: inline |
The size in X direction, often also called Width.
|
Full Usage:
this.SizeY
Returns: float
Modifiers: inline |
The size in Y direction.
|
Full Usage:
this.SizeZ
Returns: float
Modifiers: inline |
The size in Z direction, also called Height.
|
|
Returns the top of the box as a Counter-Clockwise array of 4 Points. Starting at point 4 then 5, 6, and 7. Last and first point are NOT the same.
|
|
Returns the top of the box as a Counter-Clockwise array of 5 Points. Points 4, 5, 6, 7, and again 4. Last and first point are the same.
|
Full Usage:
this.TouchingSide
Parameters:
BBox
?tolerance : float
Returns: int
Modifiers: inline |
Returns a value from -1 to 6 indicating the side on which the two 3D bounding boxes
are just touching within the tolerance.
The default tolerance is 1e-6.But can also be specified as a parameter.
-1 : not touching but overlapping / one inside the other
0 : not touching, apart on at least one axis by more than tolerance
1 : other is in front of this (this.MinX touches other.MaxX)
2 : other is behind this (this.MaxX touches other.MinX)
3 : other is to the left of this (this.MinY touches other.MaxY)
4 : other is to the right of this (this.MaxY touches other.MinY)
5 : this.MinZ touches other.MaxZ
6 : this.MaxZ touches other.MinZ
|
|
|
|
|
Full Usage:
this.Volume
Returns: float
Modifiers: inline |
Returns the volume of this 3D bounding box.
|
Static members
| Static member |
Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
BBox.containsXYZ x y z box
Parameters:
float
y : float
z : float
box : BBox
Returns: bool
Modifiers: inline |
Returns TRUE if the point is inside or on a 3D bounding box.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
BBox.createUnchecked (minX, minY, minZ, maxX, maxY, maxZ)
Parameters:
float
minY : float
minZ : float
maxX : float
maxY : float
maxZ : float
Returns: BBox
Modifiers: inline |
Creates a 3D bounding box from six coordinate values. Does not verify that min values are less than or equal to max values.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the 3D bounding box expanded by a relative factor on all six sides, separately for X, Y, Z. Values between 0.0 and 1.0 shrink the box. Values larger than 1.0 expand the box. Does check for underflow if any factor is negative and raises EuclidException.
|
|
Returns a 3D bounding box expanded by distance. If expansion is negative it shrinks the Box without causing underflow. When the negative expansion is bigger than the size on any axis, both Min and Max values on that axis will be set to the midpoint of their original values (the box collapses to a plane or line on that axis).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the intersection of two 3D bounding boxes. The returned BBox is the volume that is inside both input 3D bounding boxes. Returns ValueNone if the two 3D bounding boxes do not overlap. Just touching 3D bounding boxes will return ValueSome with a zero volume collapsed BBox.
|
|
|
|
|
|
Returns TRUE if the two 3D bounding boxes do overlap or touch exactly. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other. Use BBox.isOverlappingOrClose if you want to specify a tolerance for near misses.
|
|
Returns TRUE if the two 3D bounding boxes do overlap or are apart less than the specified tolerance. Also returns TRUE if one box is completely inside the other. Also returns TRUE if one box is completely surrounding the other. A negative tolerance shrinks the effective boundaries instead of expanding them. The math works out symmetrically:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns a value from -1 to 6 indicating the side on which the two 3D bounding boxes
are just touching within a given specified tolerance.
-1 : not touching but overlapping / one inside the other
0 : not touching, apart on at least one axis by more than tolerance
1 : other is in front of this (this.MinX touches other.MaxX)
2 : other is behind this (this.MaxX touches other.MinX)
3 : other is to the left of this (this.MinY touches other.MaxY)
4 : other is to the right of this (this.MaxY touches other.MinY)
5 : this.MinZ touches other.MaxZ
6 : this.MaxZ touches other.MinZ
|
|
|
|
|
|
|
|
Euclid