Builtin Library
README.md
sdf.sample (procNode)
A shape's signed distance read at every point of a geometry, or at positions from a field, as a Field<Float>: how a graph reads how far points are from a surface, or whether they are inside it.
Inputs
sdf(Sdf): The shape being read.geometry(Geometry, optional): Whose points the shape is read at, one value per point. Either this orpositionis wired.position(Field<Vec3>, optional): Positions read straight from a field. Takes precedence overgeometrywhen both are wired.
Outputs
field(Field<Float>): the signed distance at each element, negative inside the shape.
With neither geometry nor position wired the cook is refused.
Example
local pts = g.points.grid({ countX = 8, countZ = 8, spacing = 0.25 })
pts.point.d = g.sdf.sample({ sdf = g.sdf.sphere({ radius = 0.5 }), geometry = pts })