shrinkfaces
Shrinks each face of a patch toward its center, leaving gaps between faces.
Category: Graphics > 2-D and 3-D Plots
Syntax
nfv = shrinkfaces(fv, sf)
Returns face and vertex data in which every face is scaled by sf.
shrinkfaces(p, sf)
Shrinks the faces of the patch with handle p in place.
Description
Each face is scaled about its own centroid. Because neighboring faces must move independently, the vertex list is rebuilt with one copy of the vertices per face. The result helps to see the individual faces of an isosurface or a mesh.
Input arguments
fv- Struct with fields
facesandvertices, as returned byisosurface. p- Handle of a patch object.
sf- Shrink factor between 0 and 1. A value of 0.5 halves each face; 1 leaves it unchanged.
Output arguments
nfv- Struct with
facesandvertices. Each original face now owns its own vertices, so vertices are no longer shared between faces.
Example
Same number of faces, smaller faces
[x, y, z] = meshgrid(1:3);
fv = isosurface(x, y, z, x + y + z, 6);
fv2 = shrinkfaces(fv, 0.5);
disp(size(fv.faces, 1) == size(fv2.faces, 1))
Output
1