# FixtureFromPointAndLine3D

The FixtureFromPointAndLine3D function is used to construct a fixture from a Point3D structure and a Line3D structure. 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 FixtureFromPointandLine3D function, define a Point3D structure and a Line3D structure 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 projection point of the input point on the input line.

- The X-axis of the output 3D fixture is aligned with the input line, with the positive direction of the X-axis aligned with the positive direction of the input line.

- The Y-axis of the output 3D fixture is aligned with the line that runs through the origin and the input point, with a positive direction toward the input point.

- The Z-axis of the output 3D fixture is perpendicular to the X and Y axes, with a positive direction defined by the right-hand rule from the X-axis to the Y-axis.

  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.

Inputs

The FixtureFromPointAndLine3D function has the following syntax:

FixtureFromPointAndLine3D(PointCloud,Point3D,ExternalPoint,Line3D,ExternalLine,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.
Point3D | Specifies the offset of the 3D point to use for constructing the fixture. It is offset from the PointCloud origin in the following format with the following arguments: {X, Y, Z}
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.
External Point | Specifies a reference to a Point3D structure defined in another cell to be used by the function. Set to 0 (OFF) to use the function's internal Point3D structure.
Line3D | Specifies the offsets of the 3D line structure to use for constructing the fixture. 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 | Specifies a reference to the Line3D structure defined in another cell to be used by the function. Set to 0 (OFF) to use the function's internal Line3D structure instead.
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.

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)

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.