# LineFromRectangles3D

The LineFromRectangles3D function is used to construct a line segment from the intersection of two Rectangle3D structures. It returns the constructed line segment as a Line3D structure.

## LineFromRectangles3D Inputs

The LineFromRectangles3D function has the following syntax:

LineFromRectangles3D(PointCloud,Rectangle3D0,ExternalRectangle0,Rectangle3D1,ExternalRectangle1,Show)

See the table for a description of the available parameters.

Parameter | Description
PointCloud | Reference to a cell containing a point cloud. The default value is $A$0.
Rectangle3D 0 | Specifies the dimensions, offset and angle of the function's second 3D rectangle to use for constructing the line. It is offset from the PointCloud origin in the following format with the following arguments: {SizeX, SizeY, X, Y, Z, AngleX, AngleY, AngleZ}
SizeX | The rectangle's size along the PointCloud X-axis.
SizeY | The rectangle's size along the PointCloud Y-axis.
X | Offset on the X-axis from the PointCloud origin.
Y | Offset on the Y-axis from the PointCloud origin.
Z | Offset on the Z-axis from the PointCloud origin.
Rotation | Specifies the in-plane rotation of the first rectangle (in degrees) about the PointCloud Z-axis. The value range is -360 to 360. External references with values outside the allowed range will be normalized to the allowed range.
Tilt | Specifies the tilt angle (in degrees) of the first rectangle from the PointCloud Z-axis. The value range is 0 - 180. External references with values outside the allowed range will result in an error.
Tilt Direction | Specifies the first rectangle's direction of tilt (in degrees) from the rotated PointCloud X-axis, about the tool's PointCloud Z-axis. The value range is -360 to 360. External references with values outside the allowed range will be normalized to the allowed range.
Note: This parameter is available only if External Rectangle 0 is set to 0.
External Rectangle 0 | Specifies a reference to a Rectangle3D structure defined in another cell. The function uses the referenced cell for constructing the 3D structure. Set to 0 (OFF) to use the internal Rectangle3D structure of the function.
Rectangle3D 1 | Specifies the dimensions, offset and angle of the function's second 3D rectangle to use for constructing the line. It is offset from the PointCloud origin in the following format with the following arguments: {SizeX, SizeY, X, Y, Z, AngleX, AngleY, AngleZ}
SizeX | The rectangle's size along the PointCloud X-axis.
SizeY | The rectangle's size along the PointCloud Y-axis.
X | Offset on the X-axis from the PointCloud origin.
Y | Offset on the Y-axis from the PointCloud origin.
Z | Offset on the Z-axis from the PointCloud origin.
Rotation | Specifies the in-plane rotation of the second rectangle (in degrees) about the PointCloud Z-axis. The value range is -360 to 360. External references with values outside the allowed range will be normalized to the allowed range.
Tilt | Specifies the tilt angle (in degrees) of the second rectangle from the PointCloud Z-axis. The value range is 0 - 180. External references with values outside the allowed range will result in an error.
Tilt Direction | Specifies the second rectangle's direction of tilt (in degrees) from the rotated PointCloud X-axis, about the tool's PointCloud Z-axis. The value range is -360 to 360. External references with values outside the allowed range will be normalized to the allowed range.
Note: This parameter is available only if External Rectangle 1 is set to 0.
External Rectangle 1 | Specifies a reference to the second Rectangle3D structure defined in another cell to be used for constructing the 3D structure. Set to 0 (OFF) to use the function's internal Rectangle3D structure.
Show | Selects the type of graphics to overlay on the image.
0 = hide all (default) | All graphics are hidden, except when the cell containing the function is highlighted in the spreadsheet.
1 = result graphics only | The result graphics of the function are displayed at all times.
2 = input and result graphics | The region of interest, the input data and the results are displayed at all times.

## LineFromRectangles3D Outputs

Returns | A Line3D data structure as the projected 3D line, or #ERR if any of the input parameters are invalid.
Results | When initially inserted into a cell, the following functions are automatically inserted into the spreadsheet to create a result table.
| X0 | Y0 | Z0 | X1 | Y1 | Z1
❒Line3D | GetX(Line3D, 0) | GetY(Line3D, 0) | GetZ(Line3D, 0) | GetX(Line3D, 1) | GetY(Line3D, 1) | GetZ(Line3D, 1)

## LineFromRectangles3D Vision Data Access functions

The following Structures 3D Vision Data Access functions are automatically inserted into the spreadsheet to create the result table:

Function | Description
GetX(Line3D, index) | Returns the X-axis coordinate of the 3D line point specified with the index. An index value of 0 indicates the first endpoint of the line, while a value of 1 indicates its second endpoint.
GetY(Line3D, index) | Returns the Y-axis coordinate of the 3D line point specified with the index. An index value of 0 indicates the first endpoint of the line, while a value of 1 indicates its second endpoint.
GetZ(Line3D, index) | Returns the Z-axis coordinate of the 3D line point specified with the index. An index value of 0 indicates the first endpoint of the line, while a value of 1 indicates its second endpoint.