Builtin Library
README.md
field.random
A deterministic per-element random Float in [min, max): min + (max - min) times the field.rand draw keyed by seed, graphId, nodeId and channel. A seed replays the same field on every machine, equal to hash.unitFloat to the bit.
Inputs
seed(Float). Default1. Picks which draw the whole field is. The same seed replays the same value at every element on every machine; a different seed redraws all of them.channel(Float). Default0. A second independent draw off the same seed. Two of these sharing a seed and a channel produce the identical field.min(Float). Default0. The bottom of the range each value lands in, reachable.max(Float). Default1. The top of the range, approached and not reached. Belowminthe range runs downward.graphId(String). Default"field". The graph name the draw is keyed by.nodeId(String). Default"random". The node name the draw is keyed by.
Outputs
field: a Float field in [min, max).
Example
local points = g.points.grid({ countX = 4, countZ = 1, spacing = 1 })
local out = g.attribute.set({ geometry = points, name = "v", value = g.field.random({ seed = 4, min = 5, max = 6 }) })