# FixtureFromLines3D

The FixtureFromLines3D function is used to construct a fixture from two Line3D structures. The resulting fixture is returned as a Fixture3D structure.

3D Fixture Axis Color | 3D Fixture Axis
--- | ---
Red | X
Green | Y
Blue | Z

To create a 3D fixture using the FixtureFromLines3D function, define two Line3D structures for the function to use. The function defines the 3D fixture based on the input structures in the following way:

- The origin of the output 3D fixture is the intersection point between the two input lines, or if they are not on the same plane and do not intersect, the mid-point of the shortest perpendicular line between the two input lines.
- The X-axis of the output 3D fixture is aligned with the first input line, with the positive direction of the X-axis aligned with the positive direction of the input line. The direction of the input line is from the first point to the second point of the input line.

- The Z-axis of the output 3D fixture is perpendicular to both input lines, with a positive direction determined by the right-hand rule from the first line to the second line.

  Note: The function creates the 3D fixture so that the positive direction of the fixture Z-axis always corresponds with the positive direction of the point cloud coordinate Z-axis. If the general rule would create a fixture Z-axis with a positive direction that aligns with the negative direction of the point cloud coordinate Z-axis, the function inverts the fixture Z-axis, and consequently the Y-axis.
- The Y-axis of the output 3D fixture is perpendicular to the X and Z axes, with a positive direction determined by the right-hand rule from the Z-axis to the X-axis.

## FixtureFromLines3D Inputs

The FixtureFromLines3D function has the following syntax:

FixtureFromLines3D(PointCloud,Line3D0,ExternalLine0,Line3D1,ExternalLine1,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.
Line3D 0 | Specifies the offsets of the first 3D line to use for fixturing. It is offset from the PointCloud origin in the following format with the following arguments: {X0, Y0, Z0, X1, Y1, Z1}
X0 | Offset of the 3D line's starting point on the X-axis from the PointCloud origin.
Y0 | Offset of the 3D line's starting point on the Y-axis from the PointCloud origin.
Z0 | Offset of the 3D line's starting point on the Z-axis from the PointCloud origin.
X1 | Offset of the 3D line's ending point on the X-axis from the PointCloud origin.
Y1 | Offset of the 3D line's ending point on the Y-axis from the PointCloud origin.
Z1 | Offset of the 3D line's ending point on the Z-axis from the PointCloud origin.
External Line 0 | Specifies a reference to a Line3D structure defined in another cell to be used for fixturing. Set to 0 (OFF) to use the function's internal Line3D structure instead for the first line.
Line3D 1 | Specifies the offsets of the second 3D line to use for fixturing. It is offset from the PointCloud origin in the following format with the following arguments: {X0, Y0, Z0, X1, Y1, Z1}
X0 | Offset of the 3D line's starting point on the X-axis from the PointCloud origin.
Y0 | Offset of the 3D line's starting point on the Y-axis from the PointCloud origin.
Z0 | Offset of the 3D line's starting point on the Z-axis from the PointCloud origin.
X1 | Offset of the 3D line's ending point on the X-axis from the PointCloud origin.
Y1 | Offset of the 3D line's ending point on the Y-axis from the PointCloud origin.
Z1 | Offset of the 3D line's ending point on the Z-axis from the PointCloud origin.
External Line 1 | Specifies a reference to a Line3D structure defined in another cell to be used for fixturing. Set to 0 (OFF) to use the function's internal Line3D structure instead for the second line.
Show | Selects the type of graphics to overlay on the image.
0 = hide all (default) | All graphics will be hidden, except when the cell containing the function is highlighted in the spreadsheet.
2 = input graphics only | The input data will be displayed at all times.

## FixtureFromLines3D Outputs

Returns | A Fixture3D structure that stores 3D fixture coordinates.
Results | When initially inserted into a cell, the following functions are automatically inserted into the spreadsheet to create a result table.
| X | Y | Z | Rotation | Tilt | Tilt Direction
❒Fixture3D | GetX(Fixture3D) | GetY(Fixture3D) | GetZ(Fixture3D) | GetRotation(Fixture3D) | GetTilt(Fixture3D) | GetTiltDirection(Fixture3D)

## FixtureFromLines3D 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
GetRotation(Fixture3D) | Returns the rotation of the Z-axis in degrees, also known as the in-plane rotation.
GetTilt(Fixture3D) | Returns the tilt angle of the Fixture3D structure in degrees on the Z-axis.
GetTiltDirection(Fixture3D) | Returns the tilt direction angle of the specified Fixture3D 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.
GetX(Fixture3D) | Returns the X-axis coordinate of the constructed fixture.
GetY(Fixture3D) | Returns the Y-axis coordinate of the constructed fixture.
GetZ(Fixture3D) | Returns the Z-axis coordinate of the constructed fixture.