fvc = surf2patch(Z)
fvc = surf2patch(X, Y, Z)
fvc = surf2patch(X, Y, Z, C)
fvc = surf2patch(h)
fvc = surf2patch(..., 'triangles')
[F, V] = surf2patch(...)
[F, V, C] = surf2patch(...)
| Parameter | Description |
|---|---|
| X, Y, Z | the surface coordinates. X and Y may be vectors or matrices; Z is a matrix with at least two rows and two columns. |
| C | the color data; defaults to Z when omitted. |
| h | a surface object whose data is converted. |
| Parameter | Description |
|---|---|
| fvc | a structure with the fields 'faces', 'vertices' and 'facevertexcdata', suitable for patch. |
| F, V, C | the faces, vertices and face/vertex color data returned separately. |
surf2patch converts the geometry of a surface into the faces and vertices of a patch. The grid of a (m)-by-(n) surface becomes (m-1)*(n-1) quadrilateral faces (or twice as many triangular faces with the 'triangles' option).
Called with a single output, the result is a structure that can be passed directly to patch; with several outputs the faces, vertices and color data are returned separately.
f = figure();
colormap(jet);
patch(surf2patch(peaks(20)), 'FaceColor', 'interp', 'EdgeColor', 'none');
view(3);
axis equal
| Version | Description |
|---|---|
| 2.0.0 | initial version |