Box Type
A struct of one Pnt and three Vec, representing an immutable 3D Box with any rotation in 3D space. Described by an Origin and three Edge vectors. Similar to PPlane, however the three vectors are not unitized. This implementation guarantees the box to be always valid. That means the Min X, Y and Z axes cannot be flipped individually. However the length of one of these axes might still be zero.
local local
Z-Axis Y-Axis
^ /
| 7 / 6
| +---------------+
| /| / /|
| / | / / |
4 |/ | / 5 / |
+---------------+ |
| |/ | |
| +-----------|---+
| / 3 | / 2
| / | /
|/ |/ local
+---------------+----> X-Axis
0 1
Record fields
| Record Field |
Description
|
The Origin Corner of the Box.
|
|
The Edge vector representing the X-axis of the Box.
|
|
The Edge vector representing the Y-axis of the Box.
|
|
The Edge vector representing the Z-axis of the Box.
|
Instance members
| Instance member |
Description
|
Full Usage:
this.AreaOfBiggestFace
Returns: float
|
Returns the Area of the biggest face of the box. This is the biggest of the three faces X*Y, X*Z and Y*Z.
|
Full Usage:
this.AreaOfSmallestFace
Returns: float
|
Returns the Area of the smallest face of the box. This is the smallest of the three faces X*Y, X*Z and Y*Z.
|
Full Usage:
this.AsFSharpCode
Returns: string
|
Format Box into an F# code string that can be used to recreate the box.
|
Full Usage:
this.AsString
Returns: string
|
Format Box into string with nice floating point number formatting of X, Y and Z size only. But without type name as in v.ToString()
|
Gets the axis aligned 3D Bounding Box of the Box.
|
|
|
Returns the back face of the Box in Counter-Clockwise order, 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 Box.
|
|
Returns the bottom face of the Box in Counter-Clockwise order, 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 Box.
|
|
The center of the Box.
|
|
Check for point containment in the Box. By doing 6 dot products with the sides of the rectangle. A point exactly on the edge of the Box is considered inside.
|
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 vector of the Box.
|
|
Returns edge 1 (of the 12 box edges.) The returned line is parallel to and oriented with the X-Axis.
|
|
Returns edge 1 (of the 12 box edges.) The returned line is parallel to and oriented with the Y-Axis.
|
|
Returns edge 10 (of the 12 box edges.) The returned line is parallel to and oriented with the Z-Axis.
|
|
Returns edge 11 (of the 12 box edges.) The returned line is parallel to and oriented with the Z-Axis.
|
|
Returns edge 2 (of the 12 box edges.) The returned line is parallel to and oriented with the X-Axis.
|
|
Returns edge 3 (of the 12 box edges.) The returned line is parallel to and oriented with the Y-Axis.
|
|
Returns edge 4 (of the 12 box edges.) The returned line is parallel to and oriented with the X-Axis.
|
|
Returns edge 5 (of the 12 box edges.) The returned line is parallel to and oriented with the Y-Axis.
|
|
Returns edge 6 (of the 12 box edges.) The returned line is parallel to and oriented with the X-Axis.
|
|
Returns edge 7 (of the 12 box edges.) The returned line is parallel to and oriented with the Y-Axis.
|
|
Returns edge 8 (of the 12 box edges.) The returned line is parallel to and oriented with the Z-Axis.
|
|
Returns edge 9 (of the 12 box edges.) The returned line is parallel to and oriented with the Z-Axis.
|
|
Returns the 12 box edges. The returned line is parallel to and oriented with the X-Axis, Y-Axis or Z-Axis.
|
Full Usage:
this.EvaluateAt
Parameters:
float
yParameter : float
zParameter : float
Returns: Pnt
Modifiers: inline |
Evaluate a X, Y and Z parameter of the Box. 0.0, 0.0, 0.0 returns the Origin. 1.0, 1.0, 1.0 returns the FarCorner.
|
|
Returns 6 face of the Box in The normal 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.
|
|
The corner diagonally opposite of corner from Origin.
|
|
Returns the front face of the Box in Counter-Clockwise order, 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 Box.
|
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
|
|
Intersects an infinite ray (Line3D extended infinitely in both directions) with this Box. Uses the slab intersection method in the box's local coordinate system. Returns None if the ray does not intersect the box or if the ray direction is too short. Returns Some with entry and exit parameters on the ray if it intersects. A parameter of 0.0 corresponds to the ray's From point, 1.0 to its To point.
|
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.
|
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.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.
|
|
Returns the left face of the Box in Counter-Clockwise order, 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 Box.
|
Full Usage:
this.LongestEdge
Returns: float
Modifiers: inline |
Returns the longest edge of the Box.
|
Full Usage:
this.LongestEdgeSq
Returns: float
Modifiers: inline |
Returns the square length of longest edge of the Box.
|
|
|
|
|
|
|
|
Gets the Plane that this box is based on.
|
|
Returns the bottom corners of the Box in Counter-Clockwise order, starting at Origin. Then the top corners staring above Origin. Returns an array of 8 Points.
|
Returns point 0 of the box, same box.Origin.
|
|
Returns point 1 of the box.
|
|
Returns point 2 of the box.
|
|
Returns point 3 of the box.
|
|
Returns point 4 of the box.
|
|
Returns point 5 of the box.
|
|
Returns point 6 of the box.
|
|
Returns point 7 of the box.
|
|
|
Returns the right face of the Box in Counter-Clockwise order, 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 Box.
|
|
Multiplies (or applies) a Quaternion to a 3D box. The box is rotated around the World Origin.
|
Full Usage:
this.RotateWithCenter
Parameters:
Pnt
q : Quaternion
Returns: Box
Modifiers: inline |
Multiplies (or applies) a Quaternion to a 3D box around a given center point.
|
|
|
|
|
Full Usage:
this.ShortestEdge
Returns: float
Modifiers: inline |
Returns the shortest edge of the Box.
|
Full Usage:
this.ShortestEdgeSq
Returns: float
Modifiers: inline |
Returns the square length of shortest edge of the Box.
|
Full Usage:
this.SizeX
Returns: float
Modifiers: inline |
The size in X direction.
|
Full Usage:
this.SizeXSq
Returns: float
Modifiers: inline |
The size in X direction squared.
|
Full Usage:
this.SizeY
Returns: float
Modifiers: inline |
The size in Y direction.
|
Full Usage:
this.SizeYSq
Returns: float
Modifiers: inline |
The size in Y direction squared.
|
Full Usage:
this.SizeZ
Returns: float
Modifiers: inline |
The size in Z direction.
|
Full Usage:
this.SizeZSq
Returns: float
Modifiers: inline |
The size in Z direction squared.
|
|
Returns the top face of the Box in Counter-Clockwise order, looking from above. Returns Origin at point 4, X-Axis to point 5, Y-Axis to point 7. The normal of the Rect3D points away from the Box.
|
|
|
|
Multiplies (or applies) a RigidMatrix to a 3D box. The returned Box is guaranteed to have still orthogonal vectors.
|
Full Usage:
this.Volume
Returns: float
Modifiers: inline |
Calculates the volume of the Box.
|
|
Creates a unitized version of the local X-Axis.
|
|
Creates a unitized version of the local Y-Axis.
|
|
Creates a unitized version of the local Z-Axis.
|
Static members
| Static member |
Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the 3D 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.
|
|
|
|
Intersects an infinite ray (Line3D extended infinitely in both directions) with the Box. Uses the slab intersection method in the box's local coordinate system. Returns None if the ray does not intersect the box or if the ray direction is too short. Returns Some with entry and exit parameters on the ray if it intersects. A parameter of 0.0 corresponds to the ray's From point, 1.0 to its To point.
|
|
|
|
|
|
|
|
|
|
|
|
Multiplies (or applies) a Quaternion to a 3D box. The box IsRotated around the World Origin.
|
Full Usage:
Box.rotateWithCenter cen q b
Parameters:
Pnt
q : Quaternion
b : Box
Returns: Box
Modifiers: inline |
Multiplies (or applies) a Quaternion to a 3D box around a given center point.
|
|
|
|
|
Full Usage:
Box.transformRigid m b
Parameters:
RigidMatrix
b : Box
Returns: Box
Modifiers: inline |
Transforms the Box by the given RigidMatrix. The returned Box is guaranteed to have still orthogonal vectors.
|
|
|
|
|
|
|
|
Euclid