# BoxFromRectangle3D

The BoxFromRectangle3D function is used to construct a 3D box object from the specified Rectangle3D structure. The constructed box is returned as a Box3D structure.

## BoxFromRectangle3D Inputs

The BoxFromRectangle3D function has the following syntax:

BoxFromRectangle3D(PointCloud,Rectangle3D,ExternalRectangle,Height,Offset,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 | Specifies the dimensions, offset and angle for the 3D rectangle of the function. Double-click on the Rectangle3D parameter in the property sheet to adjust the rectangle on the acquisition display. Rectangle3D is offset from the PointCloud origin or the external fixture in the following format with the following arguments: {SizeX, SizeY, X, Y, Z, Rotation, Tilt, TiltDirection}
SizeX | The size of the rectangle along the PointCloud X-axis.
SizeY | The size of the rectangle 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 in degrees around the PointCloud Z-axis of the tool. The value range is -360 to 360. The tool normalizes external references with values outside the allowed range to the allowed range.
Tilt | Specifies the tilt angle in degrees from the PointCloud Z-axis of the tool. The value range is 0 - 180. External references with values outside the allowed range result in an error.
Tilt Direction | Specifies the direction of tilt in degrees from the rotated PointCloud X-axis of the tool, around the PointCloud Z-axis of the tool. The value range is -360 to 360. The tool normalizes external references with values outside the allowed range to the allowed range.
Note: This parameter is only available if you set External Rectangle to 0.
External Rectangle | 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.
Height | Specifies the height of the 3D box to construct.
Offset | Specifies the signed distance above or below the rectangle to position the center of the box. The value range is -inf. to inf., and the default value is 0. Having the value set to 0 means that the 3D rectangle will be positioned at the center of the constructed box.
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.

## BoxFromRectangle3D Outputs

Returns | A Box3D data structure containing the constructed 3D box, 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.
| SizeX | SizeY | SizeZ | X | Y | Z | Rotation | Tilt | Tilt Direction
❒Box3D | GetSizeX(Box3D) | GetSizeY(Box3D) | GetSizeZ(Box3D) | GetX(Box3D) | GetY(Box3D) | GetZ(Box3D) | GetRotation(Box3D) | GetTilt(Box3D) | GetTiltDirection(Box3D)

## BoxFromRectangle3D 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
GetSizeX(Box3D) | Returns the size of the 3D box along the X-axis.
GetSizeY(Box3D) | Returns the size of the 3D box along the Y-axis.
GetSizeZ(Box3D) | Returns the size of the 3D box along the Z-axis.
GetX(Box3D) | Returns the X-axis coordinate of the center of the 3D box.
GetY(Box3D) | Returns the Y-axis coordinate of the center of the 3D box.
GetZ(Box3D) | Returns the Z-axis coordinate of the center of the 3D box.
GetRotation(Box3D) | Returns the rotation of the Z-axis in degrees, also known as the in-plane rotation.
GetTilt(Box3D) | Returns the tilt angle of the Box3D structure in degrees on the Z-axis.
GetTiltDirection(Box3D) | Returns the tilt direction angle of the specified Box3D structure in degrees. The angle is measured in the X-Y plane of the original reference coordinate system, and specifies the direction for the projection of the tilted Z-axis onto that plane.