Rect3D Type
An immutable planar 3D-rectangle with any rotation in 3D space. Described by an Origin and two Edge vectors. Similar to PPlane, however the two vectors are not unitized. This implementation guarantees the 3D-rectangle to be always valid. That means the X and Y axes are always perpendicular to each other. However the length of one of these axes might still be zero. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
Record fields
Record Field |
Description
|
The Origin Corner of the 3D-rectangle.
|
|
The edge vector representing the X-axis of the 3D-rectangle. Also called Length.
|
|
The edge vector representing the Y-axis of the 3D-rectangle.
|
Instance members
Instance member |
Description
|
Full Usage:
this.Area
Returns: float
Modifiers: inline |
Calculates the area of the 3D-rectangle.
|
Full Usage:
this.AreaSq
Returns: float
Modifiers: inline |
Calculates the squared area of the 3D-rectangle. by using the squared lengths of the X and Y axis. This is a bit faster than calculating the area and good enough for relative comparisons or sorting by size.
|
Full Usage:
this.AsString
Returns: string
|
Format the 3D-rectangle 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 3D-rectangle.
|
|
|
Gets the axis aligned 2D Bounding Rectangle of the 3D-rectangle. The z-coordinate components are ignored.
|
|
Returns the center of the 3D-rectangle.
|
|
Returns the diagonal vector of the 3D-rectangle. From Origin to FarCorner.
|
|
Returns the diagonal 3D line from point 0 to 2 of the 2D rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns a 3D line from point 0 to 1 of the 2D rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns a 3D line from point 1 to 2 of the 2D rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns a 3D line from point 2 to 3 of the 2D rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns a 3D line from point 3 to 0 of the 2D rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the local X side as the 2D line from point 0 to 1 of the 2D rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the local Y side as 3D line from point 0 to 3 of the 2D rectangle. This is the reverse of Edge30. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the 4 Edges of the 3D-rectangle in Counter-Clockwise order, starting at Origin. Returns an array of 4 Lines: from point 0 to 1, 1 to 2 to 3 and 3 to 0. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
Full Usage:
this.EvaluateAt
Parameters:
float
yParameter : float
Returns: Pnt
Modifiers: inline |
Evaluate a X and Y parameter of the 3D-rectangle. 0.0, 0.0 returns the Origin. 1.0, 1.0 returns the FarCorner.
|
Full Usage:
this.EvaluateDist
Parameters:
float
yDistance : float
Returns: Pnt
Modifiers: inline |
Evaluate a point at X and Y distance on the respective axes of the 2D Rectangle.
|
|
Returns the corner diagonally opposite of corner from Origin (point 2). local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the Rectangle flipped. Or rotated 180 around its diagonal from point 1 to 3. The normal of the rectangle gets flipped. Origin will be at point 2, X-axis points down to to point 1, Y-axis points left to point 3. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns one of the 4 Edges as 3D Line: Edge 0: from point 0 to 1 Edge 1: from point 1 to 2 Edge 2: from point 2 to 3 Edge 3: from point 3 to 0 local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the Normal Resulting from the Cross Product of r.Xaxis with r.Yaxis.
|
|
Returns the unitized Normal. Resulting from the Cross Product of r.Xaxis with r.Yaxis.
|
|
Gets the Plane that this 3D-rectangle is based on.
|
|
Returns the 4 corners of the 3D-rectangle in Counter-Clockwise order, starting at Origin. Returns an array of 4 Points: point 0 then 1, 2 and 3. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the 4 corners of the 3D-rectangle als closed loop in Counter-Clockwise order, starting at Origin. First and last point are the same. Returns an array of 5 Points: point 0 then 1, 2, 3 and again 0. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
Returns point 0 of the 3D-rectangle. Same as member rect.Origin. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns point 1 of the 3D-rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns point 2 of the 3D-rectangle. Same as rect.FarCorner. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns point 3 of the 3D-rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
|
Returns the Rectangle rotated 180 degrees around its center. Returns the same rectangle with a new orientation rotated by 180 degrees around its center. This only changes the internal representation of the rectangle, the appearance is not changed. Origin will be at point 2, X-axis to to point 3, Y-axis to point 1. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the same rectangle with a new orientation rotated by 90 degrees counter clockwise around its center. This only changes the internal representation of the rectangle, the appearance is not changed. Origin will be at point 1, X-axis to to point 2, Y-axis to point 0. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Returns the same rectangle with a new orientation rotated by 90 degrees clockwise around its center. This only changes the internal representation of the rectangle, the appearance is not changed. Origin will be at point 3, X-axis to to point 0, Y-axis to point 2. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
Full Usage:
this.SizeX
Returns: float
Modifiers: inline |
The size in X direction
|
Full Usage:
this.SizeXSq
Returns: float
Modifiers: inline |
The squared size in X direction
|
Full Usage:
this.SizeY
Returns: float
Modifiers: inline |
The size in Y direction
|
Full Usage:
this.SizeYSq
Returns: float
Modifiers: inline |
The squared size in Y direction
|
|
Returns the corner at end of X-axis (point 1). local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Creates a unitized version of the local X-Axis.
|
|
Returns the corner at end of Y-axis (point 3). local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
Creates a unitized version of the local Y-Axis.
|
Static members
Static member |
Description
|
|
|
|
Creates a 3D-rectangle from three points. Fails if points are too close to each other or all colinear. The Origin, a point in X-axis direction and length, and a point for the length in Y-axis direction. Origin and x-point define the X-axis orientation of the Rectangle. The y-point only defines the length and side of the Y axis. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the projected oriented bounding box of the points. Adjusts the 3D-rectangle to contain the projections of all given points. Keeps the same plane and the same X- and Y-axis as the input rectangle. For a 3D oriented bounding box use the Box.createFromPlaneAndPoints function.
|
|
Returns the Rectangle flipped. Or rotated 180 around its diagonal from point 1 to 3. Origin will be at point 2, X-axis points down to to point 1, Y-axis points left to point 3. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
|
|
Divides a a 3D-rectangle into a grid of points. It will create as few as points as possible respecting the maximum segment length. The input maxSegmentLength is multiplied by factor 0.0001 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more. The returned array is divided along the x-axis. The sub-array is divided along the y-axis.
|
|
Divides a a 3D-rectangle into a grid of points. It will create as many points as possible respecting the minimum side length for x and y. The input minSegmentLength is multiplied by factor 0.9999 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer. The returned array is divided along the x-axis. The sub-array is divided along the y-axis.
|
|
|
|
|
|
|
Full Usage:
Rect3D.offsetCorner (rect, corner, xOffset, yOffset, xWidth, yHeight)
Parameters:
Rect3D
-
The 3D-rectangle
corner : int
-
The Index of the corner to Offset
local
Y-Axis
^
|
| 2
3 +------------+
| |
| |
| |
| |
| | local
+------------+-----> X-Axis
0-Origin 1
xOffset : float
-
The local offset distances in x direction. (Applies to the y side.) Positive values offset to the inside of the rectangle, negative values will offset outwards.
yOffset : float
-
The local offset distances in y direction. (Applies to the x side.) Positive values offset to the inside of the rectangle, negative values will offset outwards.
xWidth : float
-
The the width (or size in x direction) that will be added to the current offset.
yHeight : float
-
The the height (or size in y direction) that will be added to the current offset.
Returns: Rect3D
A new 3D-rectangle. It will always have the same x and y axis orientation as the input rectangle. Independent of negative or positive offsets
|
Offsets a local Rect3D at one of the four corners.
|
Full Usage:
Rect3D.offsetEdge (rect, edgeIdx, offEdge, width, offStart, offEnd)
Parameters:
Rect3D
-
The 3D-rectangle
edgeIdx : int
-
The Index of the edge to offset
local
Y-Axis
^
|
| 2
+------------+
| |
| |
3| |1
| |
| | local
+------------+-----> X-Axis
0
offEdge : float
-
The local offset distances parallel to the edge.
width : float
-
The width of the new rectangle. This is like the second offset to be applied to the first offset of offEdge
offStart : float
-
The local offset distances perpendicular to the edge at the start.
offEnd : float
-
The local offset distances perpendicular to the edge at the end.
Returns: Rect3D
A new 3D-rectangle. It will always have the same x and y axis orientation as the input rectangle. Independent of negative or positive offsets
|
Offsets a local Rect3D at one of the four corners.
|
|
Offset a Rect3D like a Polyline inwards by four distances. The distance array is for Edge01, Edge12, Edge23 and Edge30 respectively. Fails if the distance is larger than half the size of the rectangle. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|
|
|
|
Divides a 3D-rectangle into a grid of sub-rectangles. The sub-rectangles are returned as an array of arrays. The gap between the sub-rectangles is given in x and y direction. It does not apply to the outer edges of the 3D-rectangle. The returned array has xCount elements, each element is an array of yCount sub-rectangles.
|
Divides a a 3D-rectangle into a grid of sub-rectangles. The gap between the sub-rectangles is given in x and y direction. It does not apply to the outer edges of the 3D-rectangle. It will create as few as segments as possible respecting the maximum segment length. The input maxSegmentLength is multiplied by factor 1.00001 of to avoid numerical errors. That means in an edge case there are fewer segments returned, not more. The returned array is divided along the x-axis. The sub-array is divided along the y-axis.
|
|
Divides a a 3D-rectangle into a grid of sub-rectangles. The gap between the sub-rectangles is given in x and y direction. It does not apply to the outer edges of the 3D-rectangle. It will create as many sub-rectangles as possible respecting the minimum side length for x and y. The input minSegmentLength is multiplied by factor 0.99999 of to avoid numerical errors. That means in an edge case there are more segments returned, not fewer. The returned array is divided along the x-axis. The sub-array is divided along the y-axis.
|
|
|
Transform the 3D-rectangle by the given RigidMatrix. The returned 3D-rectangle is guaranteed to have orthogonal vectors.
|
|
|
|
|
|
|
|
Tries to create a 3D-rectangle from three points. Returns None if points are too close to each other or all colinear.. The Origin, a point in X-axis direction and length, and a point for the length in Y-axis direction. Origin and x-point define the X-axis orientation of the Rectangle. The y-point only defines the length and side of the Y axis. local Y-Axis ^ | | 2 3 +------------+ | | | | | | | | | | local +------------+-----> X-Axis 0-Origin 1
|