Header menu logo Euclid

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

Origin

Full Usage: Origin

Field type: Pnt

The Origin Corner of the 3D-rectangle.

Field type: Pnt

Xaxis

Full Usage: Xaxis

Field type: Vec

The edge vector representing the X-axis of the 3D-rectangle. Also called Length.

Field type: Vec

Yaxis

Full Usage: Yaxis

Field type: Vec

The edge vector representing the Y-axis of the 3D-rectangle.

Field type: Vec

Instance members

Instance member Description

this.Area

Full Usage: this.Area

Returns: float
Modifiers: inline

Calculates the area of the 3D-rectangle.

Returns: float

this.AreaSq

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.

Returns: float

this.AsString

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()

Returns: string

this.BBox

Full Usage: this.BBox

Returns: BBox

Gets the axis aligned 3D Bounding Box of the 3D-rectangle.

Returns: BBox

this.BRect

Full Usage: this.BRect

Returns: BRect

Gets the axis aligned 2D Bounding Rectangle of the 3D-rectangle. The z-coordinate components are ignored.

Returns: BRect

this.Center

Full Usage: this.Center

Returns: Pnt
Modifiers: inline

Returns the center of the 3D-rectangle.

Returns: Pnt

this.Diagonal

Full Usage: this.Diagonal

Returns: Vec
Modifiers: inline

Returns the diagonal vector of the 3D-rectangle. From Origin to FarCorner.

Returns: Vec

this.DiagonalLine

Full Usage: this.DiagonalLine

Returns: Line3D
Modifiers: inline
 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: Line3D

this.Edge01

Full Usage: this.Edge01

Returns: Line3D
Modifiers: inline
 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: Line3D

this.Edge12

Full Usage: this.Edge12

Returns: Line3D
Modifiers: inline
 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: Line3D

this.Edge23

Full Usage: this.Edge23

Returns: Line3D
Modifiers: inline
 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: Line3D

this.Edge30

Full Usage: this.Edge30

Returns: Line3D
Modifiers: inline
 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: Line3D

this.EdgeX

Full Usage: this.EdgeX

Returns: Line3D
Modifiers: inline
 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: Line3D

this.EdgeY

Full Usage: this.EdgeY

Returns: Line3D
Modifiers: inline
 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: Line3D

this.Edges

Full Usage: this.Edges

Returns: Line3D[]
 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
Returns: Line3D[]

this.EvaluateAt

Full Usage: this.EvaluateAt

Parameters:
    xParameter : 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.
xParameter : float
yParameter : float
Returns: Pnt

this.EvaluateDist

Full Usage: this.EvaluateDist

Parameters:
    xDistance : float
    yDistance : float

Returns: Pnt
Modifiers: inline

Evaluate a point at X and Y distance on the respective axes of the 2D Rectangle.

xDistance : float
yDistance : float
Returns: Pnt

this.FarCorner

Full Usage: this.FarCorner

Returns: Pnt
Modifiers: inline
 Returns the corner diagonally opposite of corner from Origin (point 2).

   local
   Y-Axis
   ^
   |
   |             2
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-Axis
  0-Origin       1
Returns: Pnt

this.Flipped

Full Usage: this.Flipped

Returns: Rect3D
 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: Rect3D

this.GetEdge

Full Usage: this.GetEdge

Parameters:
    i : int

Returns: Line3D
 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
i : int
Returns: Line3D

this.Normal

Full Usage: this.Normal

Returns: Vec
Modifiers: inline

Returns the Normal Resulting from the Cross Product of r.Xaxis with r.Yaxis.

Returns: Vec

this.NormalUnit

Full Usage: this.NormalUnit

Returns: Vec

Returns the unitized Normal. Resulting from the Cross Product of r.Xaxis with r.Yaxis.

Returns: Vec

this.Plane

Full Usage: this.Plane

Returns: PPlane
Modifiers: inline

Gets the Plane that this 3D-rectangle is based on.

Returns: PPlane

this.Points

Full Usage: this.Points

Returns: Pnt[]
 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: Pnt[]

this.PointsLooped

Full Usage: this.PointsLooped

Returns: Pnt[]
 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: Pnt[]

this.Pt0

Full Usage: this.Pt0

Returns: Pnt
Modifiers: inline
 Returns point 0 of the 3D-rectangle. Same as member rect.Origin.

   local
   Y-Axis
   ^
   |
   |             2
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-Axis
  0-Origin       1
Returns: Pnt

this.Pt1

Full Usage: this.Pt1

Returns: Pnt
Modifiers: inline
 Returns point 1 of the 3D-rectangle.

   local
   Y-Axis
   ^
   |
   |             2
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-Axis
  0-Origin       1
Returns: Pnt

this.Pt2

Full Usage: this.Pt2

Returns: Pnt
Modifiers: inline
 Returns point 2 of the 3D-rectangle. Same as rect.FarCorner.

   local
   Y-Axis
   ^
   |
   |             2
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-Axis
  0-Origin       1
Returns: Pnt

this.Pt3

Full Usage: this.Pt3

Returns: Pnt
Modifiers: inline
 Returns point 3 of the 3D-rectangle.

   local
   Y-Axis
   ^
   |
   |             2
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-Axis
  0-Origin       1
Returns: Pnt

this.RotateOrientation180

Full Usage: this.RotateOrientation180

Returns: Rect3D
 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: Rect3D

this.RotateOrientation90CCW

Full Usage: this.RotateOrientation90CCW

Returns: Rect3D
 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: Rect3D

this.RotateOrientation90CW

Full Usage: this.RotateOrientation90CW

Returns: Rect3D
 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
Returns: Rect3D

this.SizeX

Full Usage: this.SizeX

Returns: float
Modifiers: inline

The size in X direction

Returns: float

this.SizeXSq

Full Usage: this.SizeXSq

Returns: float
Modifiers: inline

The squared size in X direction

Returns: float

this.SizeY

Full Usage: this.SizeY

Returns: float
Modifiers: inline

The size in Y direction

Returns: float

this.SizeYSq

Full Usage: this.SizeYSq

Returns: float
Modifiers: inline

The squared size in Y direction

Returns: float

this.XCorner

Full Usage: this.XCorner

Returns: Pnt
Modifiers: inline
 Returns the corner at end of X-axis (point 1).

   local
   Y-Axis
   ^
   |
   |             2
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-Axis
  0-Origin       1
Returns: Pnt

this.XaxisUnit

Full Usage: this.XaxisUnit

Returns: Vec
Modifiers: inline

Creates a unitized version of the local X-Axis.

Returns: Vec

this.YCorner

Full Usage: this.YCorner

Returns: Pnt
Modifiers: inline
 Returns the corner at end of Y-axis (point 3).

   local
   Y-Axis
   ^
   |
   |             2
 3 +------------+
   |            |
   |            |
   |            |
   |            |
   |            |       local
   +------------+-----> X-Axis
  0-Origin       1
Returns: Pnt

this.YaxisUnit

Full Usage: this.YaxisUnit

Returns: Vec
Modifiers: inline

Creates a unitized version of the local Y-Axis.

Returns: Vec

Static members

Static member Description

Rect3D.createCenteredFromPlane (pl, sizeX, sizeY)

Full Usage: Rect3D.createCenteredFromPlane (pl, sizeX, sizeY)

Parameters:
    pl : PPlane
    sizeX : float
    sizeY : float

Returns: Rect3D

Give PPlane and sizes. The Rect3D's Center will be at the plane's Origin. Fails on negative sizes.

pl : PPlane
sizeX : float
sizeY : float
Returns: Rect3D

Rect3D.createFrom3Points (origin, xPt, yPt)

Full Usage: Rect3D.createFrom3Points (origin, xPt, yPt)

Parameters:
Returns: Rect3D
 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
origin : Pnt
xPt : Pnt
yPt : Pnt
Returns: Rect3D

Rect3D.createFromBRect b

Full Usage: Rect3D.createFromBRect b

Parameters:
Returns: Rect3D

Give 2D Bounding Rect.

b : BRect
Returns: Rect3D

Rect3D.createFromPlane (pl, sizeX, sizeY)

Full Usage: Rect3D.createFromPlane (pl, sizeX, sizeY)

Parameters:
    pl : PPlane
    sizeX : float
    sizeY : float

Returns: Rect3D

Give PPlane and sizes. The Rect3D's Origin will be at the plane's Origin. Fails on negative sizes.

pl : PPlane
sizeX : float
sizeY : float
Returns: Rect3D

Rect3D.createFromVectors (origin, x, y)

Full Usage: Rect3D.createFromVectors (origin, x, y)

Parameters:
Returns: Rect3D

Create a 3D-rectangle from the origin point, an x-edge and an y-edge. Fails if x and y are not perpendicularity. Fails on vectors shorter than 1e-9.

origin : Pnt
x : Vec
y : Vec
Returns: Rect3D

Rect3D.createUnchecked (origin, x, y)

Full Usage: Rect3D.createUnchecked (origin, x, y)

Parameters:
Returns: Rect3D

Create a 3D-rectangle from the origin point and X-edge and Y edge. Does not check for perpendicularity.

origin : Pnt
x : Vec
y : Vec
Returns: Rect3D

Rect3D.equals tol a b

Full Usage: Rect3D.equals tol a b

Parameters:
Returns: bool

Checks if two 3D-rectangles are equal within tolerance. Does not recognize congruent rectangles with different rotation as equal. Use a tolerance of 0.0 to check for an exact match.

tol : float
a : Rect3D
b : Rect3D
Returns: bool

Rect3D.expand dist r

Full Usage: Rect3D.expand dist r

Parameters:
Returns: Rect3D

Returns the 3D-rectangle expanded by distance on all four sides. Does check for underflow if distance is negative and raises EuclidException.

dist : float
r : Rect3D
Returns: Rect3D

Rect3D.expandXY distX distY r

Full Usage: Rect3D.expandXY distX distY r

Parameters:
    distX : float
    distY : float
    r : Rect3D

Returns: Rect3D

Returns the 3D-rectangle expanded by respective distances on all four sides. Does check for overflow if distance is negative and fails. distX, distY are for the local X and Y-axis respectively.

distX : float
distY : float
r : Rect3D
Returns: Rect3D

Rect3D.fitToPoints pts refRect

Full Usage: Rect3D.fitToPoints pts refRect

Parameters:
Returns: Rect3D

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.

pts : IList<Pnt>
refRect : Rect3D
Returns: Rect3D

Rect3D.flip r

Full Usage: Rect3D.flip r

Parameters:
Returns: Rect3D
 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
r : Rect3D
Returns: Rect3D

Rect3D.grid (rect, xCount, yCount)

Full Usage: Rect3D.grid (rect, xCount, yCount)

Parameters:
    rect : Rect3D
    xCount : int
    yCount : int

Returns: Pnt[][]

Divides a 3D-rectangle into a grid of points. The points are returned as an array of arrays. A xCount and yCount of 2 will only return the 4 corners of the rectangle.

rect : Rect3D
xCount : int
yCount : int
Returns: Pnt[][]

Rect3D.gridMaxLength (rect, xMaxLen, yMaxLen)

Full Usage: Rect3D.gridMaxLength (rect, xMaxLen, yMaxLen)

Parameters:
    rect : Rect3D
    xMaxLen : float
    yMaxLen : float

Returns: Pnt[][]

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.

rect : Rect3D
xMaxLen : float
yMaxLen : float
Returns: Pnt[][]

Rect3D.gridMinLength (rect, xMinLen, yMinLen)

Full Usage: Rect3D.gridMinLength (rect, xMinLen, yMinLen)

Parameters:
    rect : Rect3D
    xMinLen : float
    yMinLen : float

Returns: Pnt[][]

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.

rect : Rect3D
xMinLen : float
yMinLen : float
Returns: Pnt[][]

Rect3D.move v r

Full Usage: Rect3D.move v r

Parameters:
Returns: Rect3D

Move the 3D-rectangle by a vector.(same as Rect3D.translate)

v : Vec
r : Rect3D
Returns: Rect3D

Rect3D.notEquals tol a b

Full Usage: Rect3D.notEquals tol a b

Parameters:
Returns: bool

Check if two 3D-rectangles are not equal within a given tolerance. Use a tolerance of 0.0 to check if the two rectangles are not exactly equal.

tol : float
a : Rect3D
b : Rect3D
Returns: bool

Rect3D.offset dist rect

Full Usage: Rect3D.offset dist rect

Parameters:
Returns: Rect3D

Offset a Rect3D like a Polyline inwards by a given distance. Fails if the distance is larger than half the size of the rectangle.

dist : float
rect : Rect3D
Returns: Rect3D

Rect3D.offsetCorner (rect, corner, xOffset, yOffset, xWidth, yHeight)

Full Usage: Rect3D.offsetCorner (rect, corner, xOffset, yOffset, xWidth, yHeight)

Parameters:
    rect : 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.

rect : 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

Rect3D.offsetEdge (rect, edgeIdx, offEdge, width, offStart, offEnd)

Full Usage: Rect3D.offsetEdge (rect, edgeIdx, offEdge, width, offStart, offEnd)

Parameters:
    rect : 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.

rect : 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

Rect3D.offsetVar dist rect

Full Usage: Rect3D.offsetVar dist rect

Parameters:
    dist : float[]
    rect : Rect3D

Returns: Rect3D
 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
dist : float[]
rect : Rect3D
Returns: Rect3D

Rect3D.offsetZ offsetDistance r

Full Usage: Rect3D.offsetZ offsetDistance r

Parameters:
    offsetDistance : float
    r : Rect3D

Returns: Rect3D

Offset or Translate along the local Z-axis. The local Z-axis is calculated from Cross Product of X and Y-axis of the 3D-rectangle.

offsetDistance : float
r : Rect3D
Returns: Rect3D

Rect3D.subDivide (rect, xCount, yCount, xGap, yGap)

Full Usage: Rect3D.subDivide (rect, xCount, yCount, xGap, yGap)

Parameters:
    rect : Rect3D
    xCount : int
    yCount : int
    xGap : float
    yGap : float

Returns: Rect3D[][]

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.

rect : Rect3D
xCount : int
yCount : int
xGap : float
yGap : float
Returns: Rect3D[][]

Rect3D.subDivideMaxLength (rect, xMaxLen, yMaxLen, xGap, yGap)

Full Usage: Rect3D.subDivideMaxLength (rect, xMaxLen, yMaxLen, xGap, yGap)

Parameters:
    rect : Rect3D
    xMaxLen : float
    yMaxLen : float
    xGap : float
    yGap : float

Returns: Rect3D[][]

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.

rect : Rect3D
xMaxLen : float
yMaxLen : float
xGap : float
yGap : float
Returns: Rect3D[][]

Rect3D.subDivideMinLength (rect, xMinLen, yMinLen, xGap, yGap)

Full Usage: Rect3D.subDivideMinLength (rect, xMinLen, yMinLen, xGap, yGap)

Parameters:
    rect : Rect3D
    xMinLen : float
    yMinLen : float
    xGap : float
    yGap : float

Returns: Rect3D[][]

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.

rect : Rect3D
xMinLen : float
yMinLen : float
xGap : float
yGap : float
Returns: Rect3D[][]

Rect3D.transform m r

Full Usage: Rect3D.transform m r

Parameters:
Returns: Rect3D

Transform the 3D-rectangle by the given RigidMatrix. The returned 3D-rectangle is guaranteed to have orthogonal vectors.

m : RigidMatrix
r : Rect3D
Returns: Rect3D

Rect3D.translate v r

Full Usage: Rect3D.translate v r

Parameters:
Returns: Rect3D

Translate by a 3D vector.(same as Rect3D.move)

v : Vec
r : Rect3D
Returns: Rect3D

Rect3D.translateX distX r

Full Usage: Rect3D.translateX distX r

Parameters:
Returns: Rect3D

Translate along the local X-axis of the 3D-rectangle.

distX : float
r : Rect3D
Returns: Rect3D

Rect3D.translateY distY r

Full Usage: Rect3D.translateY distY r

Parameters:
Returns: Rect3D

Translate along the local Y-axis of the 3D-rectangle.

distY : float
r : Rect3D
Returns: Rect3D

Rect3D.tryCreateFrom3Points (origin, xPt, yPt)

Full Usage: Rect3D.tryCreateFrom3Points (origin, xPt, yPt)

Parameters:
Returns: Rect3D option
 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
origin : Pnt
xPt : Pnt
yPt : Pnt
Returns: Rect3D option

Type something to start searching.