Builtin Library
README.md
sdf.cylinder (procNode)
A cylinder with flat ends and a sharp rim, as an exact signed distance field. A shape is a field of position: nothing is evaluated until something reads it, such as sdf.mesh, sdf.sample or field.substitute.
Inputs
radius(Float, default 0.5): The radius of the circular cross-section. Takes a value above 0.height(Float, default 1.0): The full length alongaxis, half of it either side ofcenter. Takes a value above 0.axis(String, default "y"): Which world axis the cylinder runs along: "x", "y" or "z".center(Vec3, default (0, 0, 0)): The middle of the cylinder.
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).
Example
local shape = g.sdf.cylinder({ radius = 0.5, height = 1, axis = "x" })
local mesh = g.sdf.mesh({ sdf = shape, resolution = 16 }).geometry