SDF & Core Engine Types
Status: stub
Full SDF documentation is planned for Phase 2. Spec source: 08_ENGINE.csl.
What SDFs are in Sigil
Section titled “What SDFs are in Sigil”A Signed Distance Field (SDF) is a function f: Vec3<World> → f32 where the output is the signed distance from the input point to the nearest surface (negative inside, positive outside).
Sigil provides a built-in Sdf type that wraps such a function and is recognized by the compiler for autodiff and composition:
// Built-in SDF primitiveslet sphere = Sdf::sphere(center, radius);let box_ = Sdf::box(min, max);
// SDFs compose with Boolean operationslet shape = sphere.union(box_).subtract(Sdf::sphere(hole_center, 0.1));
// Autodiff gives you the normal for freelet normal = Vec3::normalize((∂shape.eval)(p));Full documentation in Phase 2.