surfaceMeshShow
Syntax
Description
surfaceMeshShow( displays the
surface mesh specified by the surfaceMeshObj)surfaceMeshObj object.
surfaceMeshShow( displays the
surface mesh specified by the triangulationObj)triangulation object.
surfaceMeshShow(___,Name=Value) specifies options using
one or more name-value arguments in addition to any combination of arguments from previous
syntaxes. For example, Title="Cuboid" displays the surface mesh with the
title "Cuboid".
Examples
Define the mesh vertices and faces for a surface mesh.
vertices = [0 0 0; 0 0 1; 0 1 1; 0 0 2; 1 0.5 1]; faces = [1 2 3; 2 3 4; 2 3 5];
Create a surfaceMesh object using vertices and faces.
mesh = surfaceMesh(vertices,faces);
Display the surface mesh.
surfaceMeshShow(mesh,Title="Surface Mesh",ColorMap="hot",BackgroundColor="blue")

Create a Viewer3D object to display the surface mesh.
viewer = viewer3d;

viewer.CameraPosition = [-2 2 0];
viewer.CameraZoom = 0.5;
surfaceMeshShow(mesh,Parent=viewer,Title="Surface Mesh With Viewer")Create a triangulation object that represents a 3-D triangulation.
[x,y] = meshgrid(1:15,1:15); tri = delaunay(x,y); z = peaks(15); triangulationObject = triangulation(tri,x(:),y(:),z(:));
Display the surface mesh defined by the triangulation.
surfaceMeshShow(triangulationObject,ColorMap="summer",Title="Triangulation Object Mesh");

Input Arguments
Surface mesh data, specified as a surfaceMesh
object.
Triangulation of surface mesh, specified as a triangulation object.
Mesh vertices, specified as an M-by-3 matrix. Each row of the
matrix is of the form [x y z], specifying the coordinates of a
vertex. Each vertex has a vertex ID equal to its row number in the matrix.
M is the total number of vertices.
Mesh triangular faces, specified as an N-by-3 matrix. Each row of
the matrix is of the form [V1
V2
V3], specifying the vertex IDs of
the vertices that define the triangular face. N is the number of
faces.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example:
surfaceMeshShow(mesh,Title="Cuboid") displays the surface mesh with the
title "Cuboid".
Colormap for the surface mesh, specified as one of these options.
| Colormap Name | Color Scale |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For more information, see colormap.
Background color for the surface mesh, specified as one of these options.
RGB Triplet — A three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range
[0,1]; for example,[0.4 0.6 0.7].Hexadecimal Color Code — A character vector or a string scalar that starts with a hash symbol (
#) followed by three or six hexadecimal digits, which can range from0toF. The values are not case sensitive. Thus, the color codes"#FF8800","#ff8800","#F80", and"#f80"are equivalent.Color Name or Short Name — Specify the name of a color such as
"red"or"green". Short names specify a letter from a color name, such as"r"or"g".
RGB triplets and hexadecimal color codes are useful for specifying custom colors.
This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.
| Color Name | Short Name | RGB Triplet | Hexadecimal Color Code |
|---|---|---|---|
"red" | "r" | [1 0 0] | "#FF0000" |
"green" | "g" | [0 1 0] | "#00FF00" |
"blue" | "b" | [0 0 1] | "#0000FF" |
"cyan"
| "c" | [0 1 1] | "#00FFFF" |
"magenta" | "m" | [1 0 1] | "#FF00FF" |
"yellow" | "y" | [1 1 0] | "#FFFF00" |
"black" | "k" | [0 0 0] | "#000000" |
"white" | "w" | [1 1 1] | "#FFFFFF" |
Transparency of the surface mesh, specified as a positive scalar in the range
[0, 1]. A value of 1 makes the mesh fully
opaque, 0 makes it completely transparent, and values in between
produce semi-transparency
Data Types: single | double
Display the mesh surface as a wireframe, specified as a logical
true or false. When set to
true, the function displays the mesh surfaces as a wireframe.
Otherwise, the surface has a solid fill.
Data Types: logical
Display only mesh vertices, specified as a logical true or
false. When set to true, the function displays
only the mesh vertices.
Data Types: logical
Title for the surface mesh display, specified as a character vector or string scalar. This value is empty by default.
Data Types: char | string
Parent of the surfaceMesh object, specified as a Viewer3D object. You can create a Viewer3D object
using the viewer3d
function. When you call surfaceMeshShow without specifying a
parent, the function creates a new Viewer3D object and sets that
object as the parent. You cannot reparent a surfaceMesh object
Version History
Introduced in R2022bYou can now specify a
Viewer3Dobject as a parent to thesurfaceMeshShowfunction by using theParentname-value argument.The
surfaceMeshShowfunction displays the mesh with face colors specified by theFaceColorsproperty of the inputsurfaceMeshobject.You can save the output by using the
savefigfunction.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)