box_sdf — 3D sdf_csg op

• Data kinds: coordgrid → sdf

• Call: import fullseye as fs; fs.ledger.box_sdf(grid, center, half_extents) (to call the implementation directly, import sdf_ops; sdf_ops.box_sdf(grid, center, half_extents); from the registry, ops3d.get("box_sdf"))

Usage

The exact signed distance field of an axis-aligned box (negative inside, positive outside).

Inigo Quilez's box SDF: with q = |p-center| - half_extents,

outside = |max(q,0)| (Euclidean distance outside corners/edges/faces),

inside = min(max(q_x,q_y,q_z), 0) (negative value to the nearest face inside),

sdf = outside + inside.

half_extents is the half side length along each axis (from the centre to the face). Outside it gives the exact distance (diagonal at corners, perpendicular distance in front of faces), and inside it also gives the exact negative distance to the nearest face.

Any negative half-extent, or a malformed grid / center / half_extents, gives ValueError.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

• gear_metrology — py -3.11 examples_3d/gear_metrology.py

• render_beauty — py -3.11 examples_3d/render_beauty.py

• sdf_csg — py -3.11 examples_3d/sdf_csg.py

Ops the type connects to (they accept sdf as input)

sdf_to_occupancy · fuse_to_voxel · integrate · extract_surface_points · query_distance · sdf_union · sdf_intersect · sdf_subtract

Same category (sdf_csg)

grid_coords · sphere_sdf · plane_sdf · cylinder_sdf · torus_sdf · capsule_sdf · sdf_union · sdf_intersect


*Provenance: sdf_ops.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.