Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

featureEdges - Class: TriRep

Sharp edges of surface triangulation

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.

Inputs

TRTriangulation representation.
filterangleThe threshold angle in radians. Must be in the range . featureEdges will return adjacent triangles that have a dihedral angle that deviates from π by an angle greater than filterangle.

Outputs

FEEdges 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;
title(sprintf('TRISURF display of surface mesh\n ...
     showing mesh edges\n'));

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;
title(sprintf('TRISURF display of surface mesh\n...
     suppressing mesh edges\n...
     and showing feature edges'));

See Also

edges
DelaunayTri
  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS