Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

sdf.cone (procNode)

A cone standing on a flat circular base and tapering to a point, as a 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 base. Takes a value above 0.
  • height (Float, default 1.0): How far the tip stands above the base along axis. The cone spans this whole length, half either side of center. Takes a value above 0.
  • axis (String, default "y"): Which world axis the cone's axis runs along: "x", "y" or "z". The base faces the negative end and the tip the positive end.
  • center (Vec3, default (0, 0, 0)): The middle of the cone's height, on its axis.

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.cone({ radius = 0.5, height = 1 })
local mesh = g.sdf.mesh({ sdf = shape, resolution = 16 }).geometry