Compute normal vectors to an interpolated isosurface.


[vn] = isonormals(x, y, z, val, vert)

[vn] = isonormals(val, vert)

[vn] = isonormals(..., 'negate')


x, y, z
Coordinate vectors from which to construct a grid. The vectors are typically generated from meshgrid, but can also be the simple vectors. If omited, the value default to [x,y,z] = meshgrid(1:l, 1:m, 1:n) where [l,m,n] = size(val).
Type: double
Dimension: vector | matrix
An LxMxN matrix containing isosurface geometry function values.
Type: double
Dimension: matrix
The vertices at which to compute normal vectors. Each row contains the coordinates of a vertex. The function is so named because the vertices typically lie on an isosurface.
Type: double
Dimension: matrix


The matrix of normal vectors. There is one row for each row of vert.


The function approximates the normal vector at each vertex from the gradient of a trilinear interpolation function over the neighboring grid points.

The output normal vectors are the negatives of the gradients, so that they point downward relative to the isosurface values. The sign can be reversed using the 'negative' input.