Skip to content

reducepatch

plot · scripts/plot/draw/reducepatch.m

: reducepatch (p, r)
: nfv = reducepatch (fv, r)
: nfv = reducepatch (f, v, r)
: [nf, nv] = reducepatch (…)
: reducepatch (…, "fast")
: reducepatch (…, "verbose")

Reduce the number of faces of a patch.

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 reduction r (default 0.5) is a fraction of the number of faces when it is at most 1 and the wanted number of faces when it is greater than 1. Faces with more than three corners are first split into triangles and coincident vertices are merged. The mesh is then simplified by repeatedly collapsing its shortest edge into the edge midpoint; the number of faces never falls below the requested number nor below one, and a request that is not smaller than the present number returns the mesh unchanged.

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