Builtin Library
README.md
sdf.bend (procNode)
The space bent about one axis in proportion to the position along another, so a straight bar curls into an arc. A shape is a field of position: nothing is evaluated until something reads it, such as sdf.mesh, sdf.sample or field.substitute.
Inputs
sdf(Sdf): The shape the bent space is read in.angle(Float, default 45.0): How far the space turns, in degrees per metre travelled alongalong.axis(String, default "z"): The axis the space turns about: "x", "y" or "z". The bend happens in the plane perpendicular to it.along(String, default "x"): The axis whose coordinate drives how far the space has turned: "x", "y" or "z". It differs fromaxis; the same axis in both is refused, and sdf.twist is that case.center(Vec3, default (0, 0, 0)): The point the bend pivots about: the space is unchanged there and curves further away from it.
Outputs
sdf(Sdf): the shape, a record offield(the signed distance at each point of space, negative inside) andbounds({ min, max }, the box the shape stays inside).
The bounds are the cube around center reaching the shape's furthest bound corner.
Example
local bar = g.sdf.box({ size = vector.create(2, 0.2, 0.2) })
local arc = g.sdf.bend({ sdf = bar, angle = 45, axis = "z", along = "x" })
local mesh = g.sdf.mesh({ sdf = arc, resolution = 32 }).geometry