Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

Querying Triangulation Representations

Triangulations represent 2-D and 3-D geometric domains in application areas such as computer graphics, physical modeling, geographic information systems, medical imaging, and more. The TriRep class allows you to represent triangulations that you have imported into MATLAB or created directly in MATLAB via the Delaunay triangulation tools. The TriRep class supports geometric queries and topological queries such as adjacency and incident information. The TriRep class provides a set of methods to simplify the development of triangulation-based algorithms.

The TriRep class provides topological and geometric queries for triangulations in 2-D and 3-D space. DelaunayTri is a subclass of TriRep and inherits methods of TriRep that let you represent and manipulate other types of triangulations. You also have more advanced control over the triangulation data structure. You can represent 2-D triangulations, 3-D triangulations made up of tetrahedra or 3-D surface triangulations.

You can import a triangulation into MATLAB and query it with TriRep methods. This example uses the sample data tetmesh.

load tetmesh 

Use the TriRep constructor to create a triangulation representation of tet and X:

TR = TriRep(tet, X);

Now, you can use TriRep methods to query TR. For example, the size method provides size information for the triangulation matrix:

size(TR);

The edges method returns the edges in the triangulation in an n-by-2 matrix. n is the number of edges. The vertices of the edges index into TR.X, the array of points representing the vertex coordinates:

E = edges(TR);

The edgeAttachments method returns the simplices attached to a specified edge:

SI = edgeAttachments(TR,E(7,:));

The incenters and circumcenters methods return the incenters and circumcenters for a given simplex:

IC = incenters(TR,cell2mat(SI));
CC = circumcenters(TR, cell2mat(SI));

Note SI is a cell array because the number of simplices associated with each edge can vary.

  


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