Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

tetramesh - Tetrahedron mesh plot

Syntax

tetramesh(T,X,c)
tetramesh(T,X)
tetramesh(TR)
h = tetramesh(...)
tetramesh(...,'param','value','param','value'...)

Description

tetramesh(T,X,c) displays the tetrahedrons defined in the m-by-4 matrix T as mesh. T is usually the output of a Delaunay triangulation of a 3-D set of points. A row of T contains indices into X of the vertices of a tetrahedron. X is an n-by-3 matrix, representing n points in 3 dimension. The tetrahedron colors are defined by the vector C, which is used as indices into the current colormap.

tetramesh(T,X) uses C = 1:m as the color for the m tetrahedra. Each tetrahedron has a different color (modulo the number of colors available in the current colormap).

tetramesh(TR) displays the tetrahedra in a Triangulation representation.

h = tetramesh(...) returns a vector of tetrahedron handles. Each element of h is a handle to the set of patches forming one tetrahedron. You can use these handles to view a particular tetrahedron by turning the patch 'Visible' property 'on' or 'off'.

tetramesh(...,'param','value','param','value'...) allows additional patch property name/property value pairs to be used when displaying the tetrahedrons. For example, the default transparency parameter is set to 0.9. You can overwrite this value by using the property name/property value pair ('FaceAlpha',value) where value is a number between 0 and 1. See Patch Properties for information about the available properties.

Examples

Generate a 3-D Delaunay tessellation, then use tetramesh to visualize the tetrahedrons that form the corresponding simplex.

d = [-1 1];
[x,y,z] = meshgrid(d,d,d);  % A cube
x = [x(:);0];
y = [y(:);0];
z = [z(:);0];
% [x,y,z] are corners of a cube plus the center.
dt = DelaunayTri(x,y,z);
Tes = dt(:,:);
X = [x(:) y(:) z(:)];
tetramesh(Tes,X);
camorbit(20,0)

You can also plot the Delaunay triangulation directly.

close(gcf);
tetramesh(dt);

See Also

trimesh, trisurf, patch, delaunayn, TriRep, TriRep.freeBoundary

  


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