Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

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 along axis, half of it either side of center. 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 of field (the signed distance at each point of space, negative inside) and bounds ({ 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