Skip to Main Content Skip to Search
Product Documentation

TriRep class -

Triangulation representation

Description

TriRep provides topological and geometric queries for triangulations in 2-D and 3-D space. For example, for triangular meshes you can query triangles attached to a vertex, triangles that share an edge, neighbor information, circumcenters, or other features. You can create a TriRep directly using existing triangulation data. Alternatively, you can create a Delaunay triangulation, via DelaunayTri, which provides access to the TriRep functionality.

Construction

TriRepTriangulation representation

Methods

baryToCartConvert point coordinates from barycentric to Cartesian
cartToBary Convert point coordinates from cartesian to barycentric
circumcentersCircumcenters of specified simplices
edgeAttachmentsSimplices attached to specified edges
edgesTriangulation edges
faceNormalsUnit normals to specified triangles
featureEdgesSharp edges of surface triangulation
freeBoundaryFacets referenced by only one simplex
incentersIncenters of specified simplices
isEdge Test if vertices are joined by edge
neighborsSimplex neighbor information
sizeSize of triangulation matrix
vertexAttachmentsReturn simplices attached to specified vertices

Properties

XCoordinates of the points in the triangulation
TriangulationTriangulation data structure

Copy Semantics

Value. To learn how this affects your use of the class, see Comparing Handle and Value Classes in the MATLAB Object-Oriented Programming documentation.

Indexing

TriRep objects support indexing into the triangulation using parentheses (). The syntax is the same as for arrays.

Examples

Load a 2-D triangulation and use the TriRep constructor to build an array of the free boundary edges:

 load trimesh2d

This loads triangulation tri and vertex coordinates x, y:

trep = TriRep(tri, x,y);
fe = freeBoundary(trep)';
triplot(trep);

You can add the free edges fe to the plot:

hold on;
plot(x(fe), y(fe), 'r','LineWidth',2);
hold off;
axis([-50 350 -50 350]);
axis equal;

See Also

DelaunayTri | TriScatteredInterp

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS