sdf_csg op• Data kinds: coordgrid → sdf
• Call: import fullseye as fs; fs.ledger.sphere_sdf(grid, center, R) (to call the implementation directly, import sdf_ops; sdf_ops.sphere_sdf(grid, center, R); from the registry, ops3d.get("sphere_sdf"))
The signed distance field of a sphere: |p − center| − R (negative inside, positive outside).
grid is a coordinate array whose last axis is 3, (..., 3) (output of grid_coords or an (N,3) point cloud). center has length 3, R>=0 is the radius. The returned shape is grid.shape[:-1]. An exact SDF (gradient norm 1). sdf_offset(sphere_sdf(g,c,R), r) == sphere_sdf(g,c,R+r).
R < 0 or a malformed grid / center gives ValueError.
Computation: np.linalg.norm(grid - center, axis=-1) - R. Coordinate units carry over directly as distance units (pass the world coordinates of grid_coords and you get world units). The component order of the coordinates is the order of the last axis of grid ((x, y, z) for grid_coords), and center uses the same order.
Arguments and validation (ValueError):
• grid: float array whose last axis is 3, (..., 3) (1-D (3,) is also allowed; 0-D or a last axis other than 3 is rejected).
• center: 3 elements (numpy's ValueError if reshape(3) fails).
• R: a scalar that float() accepts. Passing a rotation matrix or the like also gives ValueError (this argument is a radius, not a pose). R < 0 is rejected; R = 0 gives the distance field from the centre itself.
Returns: float64 of grid.shape[:-1] ((nx, ny, nz) for the output of grid_coords). -R at the centre, 0 on the surface, positive outside.
Usage: grid with grid_coords → sphere_sdf / box_sdf → CSG with sdf_union / sdf_subtract → marching cubes with <= 0 as occupied (pass -sdf to voxel_to_mesh for the isosurface equivalent to iso=0).
• 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.
• annotate3d_figure — py -3.11 examples_3d/annotate3d_figure.py
• gear_metrology — py -3.11 examples_3d/gear_metrology.py
• molecule_atom_count — py -3.11 examples_3d/molecule_atom_count.py
• procedural_hand — py -3.11 examples_3d/procedural_hand.py
• render_beauty — py -3.11 examples_3d/render_beauty.py
• sdf_csg — py -3.11 examples_3d/sdf_csg.py
• sfm_recon — py -3.11 examples_3d/sfm_recon.py
sdf as input)sdf_to_occupancy · fuse_to_voxel · integrate · extract_surface_points · query_distance · sdf_union · sdf_intersect · sdf_subtract
sdf_csg)grid_coords · box_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.