sdf_union — 3D sdf_csg op

• Data kinds: sdf × sdf → sdf

• Call: import fullseye as fs; fs.ledger.sdf_union(a, b) (to call the implementation directly, import sdf_ops; sdf_ops.sdf_union(a, b); from the registry, ops3d.get("sdf_union"))

Usage

The union of two SDFs, A∪B = the element-wise min(a, b) (inside if either is negative).

The zero isosurface matches the union of both shapes' boundaries exactly. Outside it is an exact SDF (distance to the nearest surface); inside it is a conservative lower bound. a/b only need to be broadcast-compatible.

Computation: np.minimum(np.asarray(a, float64), np.asarray(b, float64)). No other checks -- if the shapes cannot broadcast, numpy raises ValueError; NaN propagates element-wise (np.minimum returns NaN). ±inf propagates exactly (min(a, +inf) = a: interoperates with the "+inf if everything is free" contract of esdf).

Input: 2 SDFs evaluated on the same grid (outputs of sphere_sdf / box_sdf / esdf etc., negative inside, positive outside). The shape may be grid_coords's (nx, ny, nz) or a point list (N,). The distance unit is that of the input.

Returns: float64 of the broadcast shape. The zero crossing (<= 0) is the occupancy of A∪B.

Note: the inside value is a lower bound of "the distance to whichever surface is nearer"; in the overlap region it comes out smaller than the true distance (larger in absolute value). This is a standard property of CSG and does not affect isosurface extraction (marching cubes) or dilation by sdf_offset. To round the seam, use sdf_smooth_union.

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_intersect · sdf_subtract · sdf_smooth_union

Same category (sdf_csg)

grid_coords · sphere_sdf · box_sdf · plane_sdf · cylinder_sdf · torus_sdf · capsule_sdf · 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.