# ExtractCrossSection3D

The ExtractCrossSection3D function allows you to extract a profile from a 3D point cloud by defining a rectangle in 3D space to use as a slicing object.

The extracted profile uses the points where the slicing rectangle intersects with the 3D point cloud, flattening the points to two dimensions. The Region of Interest is effectively a 3D box based on the defined rectangle and the thickness parameter. The extracted profile allows you to perform height analysis, measurements, and other inspection tasks on a single cross-section of the acquired 3D point cloud using additional vision tools on the output Profile3D structure.

3D Point Cloud with ExtractCrossSection3D | Profile View

The ExtractCrossSection3D function also allows you to use an External Fixture3D as input, which ensures that the function extracts the same profile for each acquisition. You can add a finding tool such as PatMax3D or Lines3D to create a fixture, and use the Fixture3D output of the finding tool as an External Fixture for the ExtractCrossSection3D function. Once the finding tool locates the trained feature for a new acquisition, the ExtractCrossSection3D function can use the located feature to align the Region of Interest in the 3D point cloud, and produce consistent profiles regardless of positioning inconsistencies in the acquisition.

You can use the Profile3D output of the ExtractCrossSection3D function as input for profile feature extraction tools. Profile feature extraction tools allow you to extract Circle3D, Point3D, and Line3D structures from the profile.

Inputs

The ExtractCrossSection3D function has the following syntax:

ExtractCrossSection3D(PointCloud, Fixture3D, ExternalFixture, Rectangle3D, ExternalRectangle, Thickness, SampleDistance, GapFillSize, VerticalDiscontinuityMode, ZDiscontinuityThreshold, InsertCliffs, CliffLength, CliffXThreshold, 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.
Fixture3D | Specifies the point cloud coordinate system in which the 3D fixture is defined. It is offset from the PointCloud origin in the following format with the following arguments: {X, Y, Z, Rotation, Tilt, TiltDirection}
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. The value range is -180 to 180. 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 after rotation. 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 -180 to 180. The tool normalizes external references with values outside the allowed range to the allowed range.
Note: The Fixture3D parameter is only available if you set External Fixture to 0.
External Fixture | Specifies a reference to a Fixture3D structure defined in another cell. The function uses the referenced cell as the fixture of the function. Set to 0 (OFF) to use the internal fixture of the function instead.
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.
Thickness | Specifies the thickness of the slicing rectangle that the function uses to search for points. Thickness defines the size of the Region of Interest on the axis perpendicular to the profile. When you define a thickness greater than 0, the function picks up points that deviate from the slicing rectangle on the perpendicular axis by a distance up to half the defined thickness in both directions, creating a flattened composite profile from the registered points.
Sample Distance | Specifies the distance between sampling points for the profile creation. A small sample distance creates a profile that highlights surface imperfections and sudden peaks or valleys. A large sample distance creates a profile that can smooth over imperfections.
Gap Fill Size | Specifies the minimum distance on the Xp-axis of the extraction rectangle between adjacent points for identifying a gap in the profile. For adjacent points with a distance below the Gap Fill Size, the function creates a continuous profile. For adjacent points with a distance above the Gap Fill Size, the function displays a gap between the two points.
Vertical Discontinuity Mode | Specifies the method of compensating for discontinuity on the Zp-axis of the extraction rectangle between adjacent points: 0 = Interpolate: draws a direct line between the two points. 1 = Z Aligned: draws a vertical line aligned with the Zp-axis from the point with a larger Zp value.
Z Discontinuity Threshold | Specifies the maximum distance on the Zp-axis between adjacent points for which the function considers the profile to be continuous.
Insert Cliffs | Specifies whether the function inserts cliffs into the profile. The function inserts cliffs on either side of a gap, dropping the Zp-axis to a negative value. Inserting cliffs allows you to extract corner points from gaps.
Cliff Length | Specifies the length of the inserted cliffs.
Cliff X Threshold | Specifies the distance on the Xp-axis between adjacent points across a gap above which the function inserts cliffs.
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 Profile3D data structure containing the extracted profile, 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:
| Num Found | Index | Profile
❒Profiles3D | GetNFound(Profiles3D) | 0 | GetProfile(Profiles3D,0)

Vision Data Access functions

The following ExtractCrossSection3D Vision Data Access functions are automatically inserted into the spreadsheet to create the result table:

Function | Description
GetNFound(Profiles3D, index) | Returns the number of extracted profiles.
GetProfile(Profiles3D, index) | Returns the extracted profile with the specified index.
GetNPoints(Profile3D) | Returns the number of points in the extracted profile
GetRectangle(Profile3D) | Returns the Rectangle3D structure used as a slicing object for the extracted profile.