|MATLAB Function Reference|
Reduce the number of patch faces
reducepatch(p,r) reduces the number of faces of the patch identified by handle
p, while attempting to preserve the overall shape of the original object. MATLAB interprets the reduction factor
r in one of two ways depending on its value:
ris less than 1,
ris interpreted as a fraction of the original number of faces. For example, if you specify
ras 0.2, then the number of faces is reduced to 20% of the number in the original patch.
ris greater than or equal to 1, then
ris the target number of faces. For example, if you specify
ras 400, then the number of faces is reduced until there are 400 faces remaining.
nfv = reducepatch(p,r) returns the reduced set of faces and vertices but does not set the
Vertices properties of patch
p. The struct
nfv contains the faces and vertices after reduction.
nfv = reducepatch(fv,r) performs the reduction on the faces and vertices in the struct
nfv = reducepatch(p) or
nfv = reducepatch(fv) uses a reduction value of
assumes the vertices are unique and does not compute shared vertices.
prints progress messages to the command window as the computation progresses.
nfv = reducepatch(f,v,r) performs the reduction on the faces in
f and the vertices in
[nf,nv] = reducepatch(...) returns the faces and vertices in the arrays
If the patch contains nonshared vertices, MATLAB computes shared vertices before reducing the number of faces. If the faces of the patch are not triangles, MATLAB triangulates the faces before reduction. The faces returned are always defined as triangles.
The number of output triangles may not be exactly the number specified with the reduction factor argument (
r), particularly if the faces of the original patch are not triangles.
This example illustrates the effect of reducing the number of faces to only 15% of the original value.
Volume Visualization for related functions
Vector Field Displayed with Cone Plots for another example