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 MaxPnt
| +---------------+
| /| / /|
| / | / / |
4 |/ | / 5 / |
+---------------+ |
| |/ | |
| +-----------|---+
| / 3 | / 2
| / | /
|/ |/
+---------------+----> X-axis
0 MinPnt 1
A BBox centered at the origin the points has these signs of X, Y and Z coordinates:
Pt0 (-,-,-)
Pt1 (+,-,-)
Pt2 (+,-,+)
Pt3 (-,-,+)
Pt4 (-,+,-)
Pt5 (+,+,-)
Pt6 (+,+,+)
Pt7 (-,+,+)
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).
|
|
Returns a 3D box representation of this 3D bounding box.
|
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 back face of the bounding box , looking from front. Returns Origin at point 3, X-axis to point 2, Y-axis to point 7. The normal of the Rect3D points into the bounding box.
|
|
Returns the bottom face of the bounding box , looking from above. Returns Origin at point 0, X-axis to point 1, Y-axis to point 3. The normal of the Rect3D points into the bounding box.
|
|
Returns the bottom of the box as a counter-clockwise array of 4 Points. Starting at MinPnt. 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 MinPnt. 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 the other 3D bounding box is inside or exactly on this 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 an 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.
|
|
Returns the six faces of the bounding box. The normals of the Rect3Ds are oriented with the X-axis, Y-axis, or Z-axis. The order of the Rect3D is: BottomFace, FrontFace, RightFace, BackFace, LeftFace, TopFace.
|
|
Returns the front face of the bounding box , looking from front. Returns Origin at point 0, X-axis to point 1, Y-axis to point 4. The normal of the Rect3D points away from the bounding box.
|
|
Returns the edge of this 3D bounding box at the specified index. Valid indices are 0 through 11. Edges use 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.GetFace
Parameters:
int
-
The index of the face to retrieve. Valid range is 0 to 5.
Returns: Rect3D
The Rect3D representing the specified face of the Box.
|
Returns the face of the box at the specified index. The order of the faces is: BottomFace, FrontFace, RightFace, BackFace, LeftFace, TopFace.
|
|
Returns the point of the box at the specified index. The order of the points is: Pt0, Pt1, Pt2, Pt3, Pt4, Pt5, Pt6, Pt7.
|
Full Usage:
this.HasVolume
Returns: bool
Modifiers: inline |
Tests if none of the X, Y, and Z axes is smaller than the zeroLength tolerance. Same as .IsValid
|
Full Usage:
this.IntersectRay
Parameters:
Line3D
-
The ray to intersect with the bounding box.
Returns: (float * float) voption
ValueNone if there is no intersection; otherwise, ValueSome(tEntry, tExit).
|
Intersects an infinite ray (a Line3D extended infinitely in both directions) with this 3D bounding box. Uses the slab intersection method. Returns ValueNone if the ray does not intersect the bounding box or if the ray direction is too short. Returns ValueSome with the entry and exit parameters on the ray if it intersects. A parameter of 0.0 corresponds to the ray's From point, and 1.0 to its To point. Contact with the boundary counts as an intersection: a ray exactly on a face intersects if its other coordinates pass through the box. A ray parallel to a slab axis and outside that axis returns ValueNone, even if it is outside by only a tiny amount such as 1e-16. A ray that touches only one box corner returns ValueSome(t, t), where t is the corner parameter.
|
|
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 axes is smaller than the zeroLength tolerance.
|
Full Usage:
this.IsLine
Returns: bool
Modifiers: inline |
Tests if two of the X, Y, and Z axes are 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. Same as b.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 none of the X, Y, and Z axes are 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. Same as b.IsPoint.
|
|
Returns the left face of the bounding box , looking from right. Returns Origin at point 0, X-axis to point 3, Y-axis to point 4. The normal of the Rect3D points into the bounding box.
|
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 MinPnt. Then the top corners starting above MinPnt. 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.
|
|
|
Returns the right face of the bounding box , looking from right. Returns Origin at point 1, X-axis to point 2, Y-axis to point 5. The normal of the Rect3D points away from the 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 face of the bounding box , looking from above. Returns Origin at point 4, X-axis to point 5, Y-axis to point 7. The normal of the Rect3D points up, away from the Box.
|
|
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 face of the box at the specified index. The order of the faces is: BottomFace, FrontFace, RightFace, BackFace, LeftFace, TopFace.
|
|
|
|
|
|
|
|
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 TRUE if all dimensions are below zero-length tolerance. Same as BBox.isZero.
|
|
|
|
|
|
Returns TRUE if all box dimensions are below zero-length tolerance. Same as BBox.isPoint.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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