Main Content

featureEdges

(Not recommended) Sharp edges of surface triangulation

featureEdges(TriRep) is not recommended. Use featureEdges(triangulation) instead.

TriRep is not recommended. Use triangulation instead.

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. For 2-D triangulations in MATLAB®, the triangles are arranged in counter-clockwise order around the attached vertex.

Note

This query is only applicable to triangular surface meshes.

example

Examples

collapse all

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

Figure contains an axes object. The axes object contains an object of type patch.

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

tr = TriRep(tri,x,y,z);
fe = featureEdges(tr,pi/6)';

Highlight the feature edges in the triangulation with a second plot.

subplot(1,2,2)
trisurf(tr,'FaceColor','cyan','EdgeColor','none', ...
     'FaceAlpha',0.8)
axis equal
hold on
plot3(x(fe),y(fe),z(fe),'k','LineWidth',1.5)
hold off

Figure contains 2 axes objects. Axes object 1 contains an object of type patch. Axes object 2 contains 25 objects of type patch, line.

Input Arguments

collapse all

Triangulation representation, specified as a TriRep or DelaunayTri object.

Threshold angle, specified as a scalar angle in radians. filterangle must be in the range (0,π). featureEdges returns adjacent triangles with a dihedral angle that deviates from π by an angle greater than filterangle.

Output Arguments

collapse all

Feature edges, returned as a matrix. 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.

Extended Capabilities

Thread-Based Environment
Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.

Version History

Introduced in R2009a