Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

field.curl

Curl noise: the curl of a three-channel gradient-noise potential, taken by central differences (step 0.01). The field swirls without sources or sinks: the motion of smoke, dust and sparks in turbulent air. A field.call of zero_flow_curl of the noise prelude.

Inputs

  • position (Field<Vec3> | Vec3, optional). Where each element samples the field. Left unwired, it is field.position(): the P column of the domain the field is evaluated over.
  • frequency (Float). Default 0.5. How tight the eddies are: about 1 / frequency between one swirl and the next.
  • amplitude (Float). Default 1. How strong the field is.
  • seed (Float). Default 1. Which of the possible patterns this is; the same seed replays the same field everywhere.

Outputs

  • field: a Vec3 field.

Example

local points = g.points.grid({ countX = 4, countZ = 1, spacing = 1 })
local out = g.attribute.set({ geometry = points, name = "v", value = g.field.curl({ frequency = 0.5, seed = 2 }) })