# PlaneFromNPoints3D

The PlaneFromNPoints3D function is used to construct a 3D plane that best fits the specified three or more Point3D input points. The constructed plane is returned as a Plane3D structure.

Inputs

The PlaneFromNPoints3D function has the following syntax:

PlaneFromNPoints3D(PointCloud,Normal Direction,Point3D 0,Point3D 1,Point3D 2,[Point3D 3, ...,Show])

See the table for a description of the available parameters.

Note: This function can accept a variable number of arguments. Therefore, the function does not have a Property Sheet. After drag-and-dropping from the Toolbox onto the spreadsheet, you must complete it manually according to the above syntax.
Note: You can add each Point3D individually or you can use a range:

Parameter | Description
PointCloud | Reference to a cell containing a point cloud. The default value is $A$0.
Normal Direction | Specifies the normal direction you want to use.
0 = UseCrossProduct | The normal direction is decided by right-handed cross-product rule.
1 = PositiveZ | Force the Z component of the normal to be positive or zero.
2 = NegativeZ | Force the Z component of the normal to be negative.
Point3D 0 | Specifies a reference to a Point3D structure defined in another cell to be used by the function as the first point for constructing the 3D plane.
Point3D 1 | Specifies a reference to a Point3D structure defined in another cell to be used by the function as the second point for constructing the 3D plane.
Point3D 2 | Specifies a reference to a Point3D structure defined in another cell to be used by the function as the third point for constructing the 3D plane.
... |
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.

Outputs

Returns | A Plane3D data structure containing the constructed 3D plane, 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.
| X | Y | Z | Tilt | Tilt Direction
❒Plane3D | GetX(Plane3D) | GetY(Plane3D) | GetZ(Plane3D) | GetTilt(Plane3D) | GetTiltDirection(Plane3D)

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(Plane3D) | Returns the X-axis coordinate of the 3D plane's center point.
GetY(Plane3D) | Returns the Y-axis coordinate of the 3D plane's center point.
GetZ(Plane3D) | Returns the Z-axis coordinate of the 3D plane's center point.
GetTiltDirection(Plane3D) | Returns the tilt direction angle of the specified Plane3D 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.
GetTilt(Plane3D) | Returns the tilt angle of the Plane3D structure in degrees on the Z-axis.