Log inGet started
Package

sdf.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

proc.ops.sdf

Modelling with signed distance fields. An SDF op describes a solid as a function (how far the nearest surface is, and whether a point is inside) and builds a new function out of the ones it is given, so two shapes merge with a smooth fillet, repetition folds a point into one tile, and shelling and displacement are arithmetic on a distance. Nothing allocates a grid until sdf.mesh contours the function or sdf.sample filters a point cloud by it; both predict their sample count from their params and refuse a count past the budget (max_samples raises it) before allocating. value, contour, meshdist and grid are the parts those ops are built from.

ops(geometry, fields, types) returns the family as a map of op id to op def; procPacks/sdf.procPack registers it. A graph calls one of its ops as g.op.<id>({ ... }) and a script as proc.ops.<family>.<op>(...); the procgen toolbox's describeNode answers each in full.

Ops: geometry.to_sdf, sdf.bend, sdf.box, sdf.capsule, sdf.cone, sdf.cylinder, sdf.displace, sdf.elongate, sdf.from_grid, sdf.intersect, sdf.mesh, sdf.mirror, sdf.plane, sdf.position, sdf.repeat, sdf.round, sdf.rounded_box, sdf.sample, sdf.shell, sdf.sphere, sdf.subtract, sdf.taper, sdf.torus, sdf.transform, sdf.twist, sdf.union.

Part of @builtin::systems.procgen.proc; required as @builtin::systems.procgen.proc.ops.sdf.