Skip to content

shrinkfaces

plot · scripts/plot/draw/shrinkfaces.m

: shrinkfaces (p, sf)
: nfv = shrinkfaces (fv, sf)
: nfv = shrinkfaces (f, v, sf)
: [nf, nv] = shrinkfaces (…)

Shrink each face of a patch towards its own centre.

The faces are given by a patch handle p, a structure fv with the fields faces and vertices, or the index matrix f and vertex matrix v. The positive scale factor sf (default 0.3) is the factor by which the area of every face is reduced, so each vertex moves to c + sqrt (sf) * (v - c) with c the centroid of its face. After shrinking, every face owns private copies of its vertices.

With a patch handle and no output argument the patch is updated; otherwise a structure (one output) or the pair nf, nv (two outputs) is returned.