tetramesh

Draws a tetrahedral mesh as semi-transparent solid elements.

Category: Mathematics > Computational Geometry

Syntax

tetramesh(T, X)

Draws the tetrahedra whose vertex indices are the rows of T, using the coordinates in X.

tetramesh(TR)

Draws the tetrahedral mesh stored in a triangulation or delaunayTriangulation object.

h = tetramesh(___)

Also returns the graphics handle of the patch objects.

Description

Each row of T selects four rows of X, and tetramesh draws the four triangular faces of that tetrahedron on the current axes. Faces are partly transparent, so the interior structure of a mesh can be seen. The axes are set to a 3-D view.

The mesh itself is usually produced by delaunayn or delaunayTriangulation applied to a 3-D point set.

Input arguments

T
m-by-4 matrix. Each row lists the four vertex indices of one tetrahedron.
X
n-by-3 matrix of vertex coordinates, one point per row.

Output arguments

h
Handle to the patch graphics object that draws the mesh.

Example

A single tetrahedron

X = [0 0 0; 1 0 0; 0 1 0; 0 0 1];
T = [1 2 3 4];
tetramesh(T, X);

See also

delaunayn delaunayTriangulation trimesh triplot