Skip to content

isosurface

plot · scripts/plot/draw/isosurface.m

: fv = isosurface (x, y, z, v, iso)
: fv = isosurface (v, iso)
: fv = isosurface (x, y, z, v)
: fv = isosurface (v)
: fv = isosurface (…, colors)
: fv = isosurface (…, "noshare")
: fv = isosurface (…, "verbose")
: [f, v, c] = isosurface (…)
: isosurface (…)

Extract the surface where a volume equals a given value.

v is an m-by-n-by-p array of values at the grid points; the grid coordinates x, y, z are 3-D arrays of that size or vectors with n, m and p elements (default 1:n, 1:m, 1:p). The surface v = iso is built from triangles whose vertices lie on the grid edges at the linearly interpolated crossing points; vertices shared by neighbouring cells are merged unless "noshare" is given. Without iso the mean of the data is used. The optional array colors, of the size of v, is interpolated to the vertices.

The result is a structure with the fields faces (k-by-3 indices) and vertices (n-by-3 coordinates), plus facevertexcdata when colors are given; with several outputs f, v and c are returned. Without an output a patch is drawn. When the surface is empty a warning is issued.