trimesh
Plots a triangular mesh as wireframe edges.
Category: Mathematics > Computational Geometry
Syntax
trimesh(T, x, y, z)
Draws the triangles listed in T as a 3-D mesh, with vertex coordinates x, y and heights z.
trimesh(T, x, y)
Draws the triangles in the plane.
trimesh(TR)
Draws the mesh of a triangulation object.
h = trimesh(___)
Also returns the handle of the mesh.
Description
trimesh draws only the edges of each triangle, with the faces left transparent, which makes it a quick way to inspect a mesh. For shaded faces, use trisurf. For a flat 2-D mesh, triplot is the usual choice.
When z is given, the vertices are lifted to those heights and the axes switch to a 3-D view.
Input arguments
T- m-by-3 matrix; each row holds three vertex indices.
x, y, z- Vectors with the coordinates of the vertices.
Output arguments
h- Handle to the patch object that draws the mesh.
Example
A mesh lifted into 3-D
x = [0 1 0 1]';
y = [0 0 1 1]';
z = [0 1 1 2]';
T = [1 2 3; 2 4 3];
trimesh(T, x, y, z);