Special field operations
In addition to basic operations like addition and multiplication, there are special operations that are specific to fields. These include vector analysis function like gradient, divergence, and curl, as well as others.
Gradient
The gradient_field
node computes the gradient of a scalar field, which is sometimes denoted by the "nabla" or "del" symbol ∇. The gradient is a vector field that shows how the scalar field is changing in the vicinity of a position.
If you imagine a 2D scalar field as a height map, the direction of its gradient indicates the steepest uphill direction from any position and the magnitude of the gradient is the slope in that direction. If you imagine a 3D scalar as representing air temperature in a room, the gradient points in the direction of the biggest increase in temperature and its length is the rate of increase.
Divergence
The divergence_field
node computes the divergence of a vector field, which is sometimes denoted by ∇· or div. The divergence measures the net flow of a vector field into or out of the region around a position. Sources where vectors originate have a positive divergence, and sinks where vectors converge have a negative divergence.
Incompressible fluid flows are divergence-free, meaning that the divergence is 0 everywhere. In other words, the density in a region cannot increase or decrease and there are no sinks or sources of fluid.
Curl
The curl_field
node computes the curl of a vector field, which is sometimes denoted by ∇× or curl. The curl measures the net rotation of the vector flow around a position. Its direction is the axis of rotation and its length is the amount of rotation. It should not be confused with curl noise, which uses the curl of a noise field to create a divergence-free turbulence.
FCurve field
The fcurve_field
node is similar to the evaluate_fcurve
node. However instead of remapping simple scalar values, you can remap the values of a scalar field based on an editable function curve.
Closest point and near point fields
The closest_point_field
node is similar to the get_closest_point
geometry query. It returns a vector field whose value at any position is the closest point on the surface (0-level set) of the shape defined by the input signed-distance field. You can use it, for example, to create a force that accelerates particles towards the closest point on a surface. However, it might not give the desired result if the input is not a true signed-distance field.
The near_point_field
node is similar to closest_point_field
, but it works with any scalar field. It follows the gradient of the scalar field toward the 0-level one or more times, and returns the new position. Use the tolerance
input to cut computations short if it reaches a plateau or local extremum, and the max_iterations
input to limit the number of steps it takes.