volumegradient expression function

Returns the gradient of a volume primitive at a specified location.

All Usage Examples

See also: volumesample

Usage

volumegradient(surface_node, prim_id, x, y, z, axis)

The gradient of a volume primitive is a three dimensional vector pointing in the direction of increasing value in the volume primitive. It is returned in surface space (as opposed to the volume’s local space or world space).

surface_node is the full path of the surface node. prim_id is the primitive number of the volume primitive within the surface node.

axis controls which component of the gradient is returned:

Returns 0 if out of bound values are specified, or the given primitive is not a volume.

Examples

volumegradient("/obj/geo1/isooffset1", 0, $TX, $TX, $TZ, 1)