Accelerating the pace of engineering and science

featureEdges

Class: TriRep

(Will be removed) Sharp edges of surface triangulation

 Note:   featureEdges(TriRep) will be removed in a future release. Use featureEdges(triangulation) instead.TriRep will be removed in a future release. Use triangulation instead.

Syntax

FE = featureEdges(TR, filterangle)

Description

FE = featureEdges(TR, filterangle) returns an edge matrix FE. This method is typically used to extract the sharp edges in the surface mesh for the purpose of display. Edges that are shared by only one triangle and edges that are shared by more than two triangles are considered to be feature edges by default.

 Note:   This query is only applicable to triangular surface meshes.

Input Arguments

 TR Triangulation representation. filterangle The threshold angle in radians. Must be in the range $\left(0,\pi \right)$. featureEdges will return adjacent triangles that have a dihedral angle that deviates from π by an angle greater than filterangle.

Output Arguments

 FE Edges of the triangulation. FE is of size m-by-2 where m is the number of computed feature edges in the mesh. The vertices of the edges index into the array of points representing the vertex coordinates, TR.X.

Examples

Create a surface triangulation:

```x = [0 0 0 0 0 3 3 3 3 3 3 6 6 6 6 6 9 9 9 9 9 9]';
y = [0 2 4 6 8 0 1 3 5 7 8 0 2 4 6 8 0 1 3 5 7 8]';
dt = DelaunayTri(x,y);
tri = dt(:,:);
```

Elevate the 2-D mesh to create a surface:

```z = [0 0 0 0 0 2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0]';
subplot(1,2,1);
trisurf(tri,x,y,z, 'FaceColor', 'cyan');
axis equal;
% TRISURF display of surface mesh
% showing mesh edges```

Compute the feature edges using a filter angle of pi/6:

```tr = TriRep(tri, x,y,z);
fe = featureEdges(tr,pi/6)';
subplot(1,2,2);
trisurf(tr, 'FaceColor', 'cyan', 'EdgeColor','none', ...
'FaceAlpha', 0.8); axis equal;
```

Add the feature edges to the plot:

```hold on;
plot3(x(fe), y(fe), z(fe), 'k', 'LineWidth',1.5);
hold off;
% TRISURF display of surface mesh
% suppressing mesh edges
% and showing feature edges```