# ExtractEdge3D

The ExtractEdge3D function is used to extract edges as Line3D structures from the specified region of the point cloud. The edges start at one plane of the specified 3D box Region of Interest (ROI), and extend to the opposite plane of the box. Each extracted edge is roughly parallel to a specific edge of the box, called the canonical edge.

The extracted edges are classified as either convex or concave, depending on the surface characteristics along the extraction direction. The extracted edges are returned in an Edges3D structure.

## ExtractEdge3D Inputs

The ExtractEdge3D function has the following syntax:

ExtractEdge3D (PointCloud,Fixture3D,ExternalFixture,Region3D,ExternalRegion,SurfaceLength,AcceptThreshold,MinimumCoverage,NumberToExtract,TransitionTypes,MinimumSharpness,MaximumSharpness,MaximumVerticalAngle,MaximumHorizontalAngle,SurfaceSeparation,FeatureSize,SortKey,SortOrder,SortReference,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.
Region3D | Specifies the dimensions, offset and angle for 3D region of interest (ROI) of the function. It is offset from the Fixture3D origin in the following format with the following arguments: {SizeX, SizeY, SizeZ, X, Y, Z, Rotation, Tilt, TiltDirection}
SizeX | The size of the ROI along the Fixture3D X-axis.
SizeY | The size of the ROI along the Fixture3D Y-axis.
SizeZ | The size of the ROI along the Fixture3D Z-axis.
X | Offset on the X-axis from the Fixture3D origin.
Y | Offset on the Y-axis from the Fixture3D origin.
Z | Offset on the Z-axis from the Fixture3D origin.
Rotation | Specifies the in-plane rotation in degrees around the Fixture3D 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 Fixture3D Z-axis of the tool 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 Fixture3D X-axis of the tool, around the Fixture3D 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 setting is only available if you set External Region to 0.
External Region | Specifies a reference to a 3D region defined in another cell. The function uses the referenced cell as the Region of Interest of the function. Set to 0 (OFF) to use the internal Box3D structure of the function as the ROI.
Surface Length | Specifies the length of the support surfaces perpendicular to the expected edge.
Accept Threshold | Specifies the minimum acceptance percentage threshold of the edges. The value range is 1 to 100, and the default value is 50.
Minimum Coverage | Specifies the minimum coverage amount. Coverage is the percentage of the support surfaces where the edge exists. Missing data on the edge will reduce coverage.
Number to Extract | Specifies the number of edges to extract in the ROI. The value range is 1 to inf., and the default value is 1.
Transition Types | Specifies whether to extract convex edges (0), concave edges (1), or both (2). By default, both edge types are extracted.
Minimum Sharpness | Specifies the minimum acceptable sharpness of the edges (in degrees). The value range is 0 to the configured value of the Maximum Sharpness attribute, and the default value is 30.
Maximum Sharpness | Specifies the maximum acceptable sharpness of the edges (in degrees). The value range is from the configured value of the Minimum Sharpness attribute to 180, and the default value is 150.
Maximum Vertical Angle | Specifies the maximum acceptable vertical angle of the edges (in degrees). The vertical angle is measured between the canonical edge and the projection of the extraction edge onto the bottom plane of the ROI. The value range is 0 to 45, and the default value is 45.
Maximum Horizontal Angle | Specifies the maximum acceptable horizontal angle of the edges (in degrees). The horizontal angle is measured between the canonical edge and the projection of the extraction edge onto the bottom plane of the ROI. The value range is 0 to 45, and the default value is 45.
Surface Separation | Specifies the separation between support surfaces. The value range is 0 to inf., and the default value is 0. Tip: Use this parameter to detect rounded or beveled edges
Feature Size | Specifies the sampling quality of the point cloud points and patches that will be used for edge extraction. The available values are the following: 0 = Large: Calculate extraction using large features. 1 = Medium: Calculate extraction using medium features. 2 = Small: Calculate extraction using small features. This is the default setting. Tip: Lower values (Large and Medium) increase extraction performance, but are less accurate. The Small value results in more accurate extraction and better noise data sensitivity, at the cost of performance.
Sort Key | Specifies the logic by which the extracted edges will be sorted. The available values are the following: None: No sorting logic will be applied to the list of edges. Use this setting if you simply want a count of the edges, or want to examine them without the need to order them. Score: The extract edges are sorted by their score value. Coverage: The extracted edges are sorted by their coverage. Sharpness: The extracted edges are sorted by their sharpness. Vertical Angle: The extracted edges are sorted by their vertical angles. Horizontal Angle: The extracted edges are sorted by their horizontal angles. Position Along Extraction Direction: The extracted edges are sorted by their positions along the extraction direction. This is the default setting. Transition Type: The extracted edges are sorted by their transition types. Note: When this key is selected, Ascending sort order means that convex edges are listed before concave edges. When Descending sort order is selected, concave edges are listed before convex edges. Edge Segment Center Spoke Angle: The extracted edges are sorted by the spoke angle of the edge segment's center. Edge Segment Center Spoke Radius: The extracted edges are sorted by the spoke radius of the edge segment's center.
Sort Order | Specifies whether to sort the results in ascending or descending order. Note: This parameter is disabled if Sort Key is set to None.
Sort Reference | Specifies the origin of the coordinate space in which the positional and rotational values are defined. The available values are the following: Camera: The coordinate space is based off the system in which the point cloud's points are defined. Region: The coordinate space is based off the coordinate system of the working region used in the job. Note: This parameter is enabled only if External Region is set to 0, and Sort Key is set to Coverage, Edge Segment Center Spoke Angle, or Edge Segment Center Spoke Radius.
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.

## ExtractEdge3D Outputs

Returns | An Edges3D data structure containing the edges extracted from the point cloud, 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 | Transition Type | Score | Coverage | Sharpness | Vertical Angle | Horizontal Angle | Line | Midpoint | X0 | Y0 | Z0 | X1 | Y1 | Z1
❒Edges3D | GetNFound(Edges3D) | 0 | GetTransitionTypeText(Edges3D, 0) | GetScore(Edges3D, 0) | GetCoverage(Edges3D, 0) | GetSharpness(Edges3D, 0) | GetVerticalAngle(Edges3D, 0) | GetHorizontalAngle(Edges3D, 0) | GetLine(Edges3D, 0) | GetMidpoint(Line3D) | GetX(Line3D, 0) | GetY(Line3D, 0) | GetZ(Line3D, 0) | GetX(Line3D, 1) | GetY(Line3D, 1) | GetZ(Line3D, 1)
|  | 1 | GetTransitionTypeText(Edges3D, 1) | GetScore(Edges3D, 1) | GetCoverage(Edges3D, 1) | GetSharpness(Edges3D, 1) | GetVerticalAngle(Edges3D, 1) | GetHorizontalAngle(Edges3D, 1) | GetLine(Edges3D, 1) | GetMidpoint(Line3D) | GetX(Line3D, 0) | GetY(Line3D, 0) | GetZ(Line3D, 0) | GetX(Line3D, 1) | GetY(Line3D, 1) | GetZ(Line3D, 1)
|  | ... | ... | ... | ... | ... | ... | ... | ... |  | ... | ... | ... |  |  |
|  | N-1* | GetTransitionTypeText(Edges3D, N-1) | GetScore(Edges3D, N-1) | GetCoverage(Edges3D, N-1) | GetSharpness(Edges3D, N-1) | GetVerticalAngle(Edges3D, N-1) | GetHorizontalAngle(Edges3D, N-1) | GetLine(Edges3D, N-1) | GetMidpoint(Line3D) | GetX(Line3D, 0) | GetY(Line3D, 0) | GetZ(Line3D, 0) | GetX(Line3D, 1) | GetY(Line3D, 1) | GetZ(Line3D, 1)
*N = min(10, NumberToExtract))

## ExtractEdge3D Vision Data Access functions

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

Function | Description
GetCoverage(Edges3D, index) | Returns the coverage of the edge specified with the index number.
GetHorizontalAngle(Edges3D, index) | Returns the horizontal angle of the edge specified with the index number.
GetLine(Edges3D, index) | Returns the line of the extracted edge with the specified index as a Line3D structure.
GetMidpoint(Line3D) | Returns the midpoint of the specified Line3D structure as a Point3D structure.
GetNFound(Edges3D) | Returns the number of found edges.
GetScore(Edges3D, index) | Returns the score of the edges specified with the index as a value between 0 and 100.
GetSharpness(Edges3D, index) | Returns the sharpness of the edge specified with the index (in degrees).
GetTransitionTypeText(Edges3D, index) | Returns the transition type of the edge specified with the index as a text (convex or concave).
GetVerticalAngle(Edges3D, index) | Returns the vertical angle of the edge specified with the index number.
GetX(Line3D, index) | Returns the X-axis coordinate of the specified line's starting point (when using index 0) or endpoint (when using index 1) on the Fixture3D X-axis.
GetY(Line3D, index) | Returns the Y-axis coordinate of the specified line's starting point (when using index 0) or endpoint (when using index 1) on the Fixture3D Y-axis.
GetZ(Line3D, index) | Returns the Z-axis coordinate of the specified line's starting point (when using index 0) or endpoint (when using index 1) on the Fixture3D Z-axis.