# RectangleFromLineSegment2D

The RectangleFromLineSegment2D function allows you to construct a rectangle from a specified two-dimensional Line.

Input LineSegment structure | Rectangle3D output

To use the RectangleFromLineSegment2D function:

1. Drag and drop the RectangleFromLineSegment2D function into the Spreadsheet.

2. In the property sheet that pops up, either define the LineSegment manually or double-click the External Line Segment parameter to open cell selection. Select the Line cell containing the Line structure you want the function to use.

3. Check the Auto Compute Z Range checkbox, or manually adjust the Z center offset and height of the Rectangle3D output structure. The acquisition display shows a preview of the Rectangle3D structure.

4. Click OK to finalize the settings.

Input

The RectangleFromLineSegment2D function has the following syntax:

RectangleFromLineSegment2D(PointCloud,Image,X0,Y0,X1,Y1,ExternalLineSegment,AutoComputeZRange,ZCenter,Height,Show)

Parameter | Description
--- | ---
PointCloud | Reference to a cell containing a point cloud. The default value is $A$0.
Image | Reference to a cell containing an Image. The default value is $A$1.
LineSegment | Specifies the coordinates of the line.
X 0 | X offset from the PointCloud origin, in real-world units.
Y 0 | Y offset from the PointCloud origin, in real-world units.
X 1 | X offset from the PointCloud origin, in real-world units.
Y 1 | Y offset from the PointCloud origin, in real-world units.
External Line Segment | Specifies a reference to a Line defined in another cell. Set to 0 (OFF) to use the internal Line of the function.
Auto Compute Z Range | Computes the Z range using the 3D points along the 2D line segment, and updates the values on the property sheet.
Z Center | Z center offset from the PointCloud origin, in real-world units.
Height | Length of the rectangle, in real-world units.
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.

Output

Returns | A Rectangle3D data structure as the projected 3D structure, 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 | X | Y | Z | Rotation | Tilt | Tilt Direction
❒Rectangle3D | GetSizeX(Rectangle3D) | GetSizeY(Rectangle3D) | GetX(Rectangle3D) | GetY(Rectangle3D) | GetZ(Rectangle3D) | GetRotation(Rectangle3D) | GetTilt(Rectangle3D) | GetTiltDirection(Rectangle3D)