Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

sdf.shell (procNode)

A solid hollowed into a wall of a given thickness, centred on its original surface. 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 solid being hollowed out.
  • thickness (Float, default 0.05): How thick the wall is, half of it either side of where the original surface was. Takes a value above 0. A wall thinner than about two cells of whatever contours it is missed.

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).

The field is abs(distance) - thickness / 2, so the result has an inner and an outer surface. The bounds grow by half the thickness.

Example

local hollow = g.sdf.shell({ sdf = g.sdf.sphere({ radius = 0.5 }), thickness = 0.1 })
local mesh = g.sdf.mesh({ sdf = hollow, resolution = 24 }).geometry