| MATLAB Function Reference | Search  Help Desk |
| isosurface | Examples See Also |
Extract isosurface data from volume data
Syntax
fv = isosurface(X,Y,Z,V,isovalue) fv = isosurface(V,isovalue) fv = isosurface(X,Y,Z,V), fv = isosurface(X,Y,Z,V) fv = isosurface(...,'noshare') fv = isosurface(...,'verbose') [f,v] = isosurface(...) isosurface(...)
Description
fv = isosurface(X,Y,Z,V,isovalue) computes isosurface data from the volume data V at the isosurface value specified in isovalue. The arrays X, Y, and Z define the coordinates for the volume V. The struct fv contains the faces and vertices of the isosurface, which you can pass directly to the patch command.
fv = isosurface(V,isovalue) assumes the arrays X, Y, and Z are defined as [X,Y,Z] = meshgrid(1:n,1:m,1:p) where [m,n,p] = size(V).
fv = isosurface(...,'noshare') does not create shared vertices. This is faster, but produces a larger set of vertices.
fv = isosurface(...,'verbose') prints progress messages to the command window as the computation progresses.
[f,v] = isosurface(...) returns the faces and vertices in two arrays instead of a struct.
isosurface(...) with no output arguments creates a patch using the computed faces and vertices.
Remarks
You can pass thefv structure created by isosurface directly to the patch command, but you cannot pass the individual faces and vertices arrays (f, v) to patch without specifying property names. For example,
patch(isosurface(X,Y,Z,V,isovalue))
or
[f,v] = isosurface(X,Y,Z,V,isovalue);
patch('Faces',f,'Vertices',v)
Examples
This example uses the flow data set, which represents the speed profile of a submerged jet within an infinite tank (typehelp flow for more information). The isosurface is drawn at the data value of -3. The statements that follow the patch command prepare the isosurface for lighting by:
isonormals)
set, FaceColor, EdgeColor)
daspect, view)
camlight, lighting)
[x,y,z,v] = flow; p = patch(isosurface(x,y,z,v,-3)); isonormals(x,y,z,v,p)set(p,'FaceColor','red','EdgeColor','none');daspect([1 1 1])view(3)camlightlightingphong

See Also
isonormals, isocaps, reducepatch, reducevolume, shrinkfaces, smooth3, subvolume