capsule_sdf — 3D sdf_csg op

• Data kinds: coordgrid → sdf

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

Usage

Exact signed distance field of a capsule formed by thickening the segment a–b by radius radius.

sdf(p) = ‖p - (a + clamp(((p-a)·(b-a))/‖b-a‖², 0, 1)·(b-a))‖ - radius. It is exactly the shortest distance to a segment, so it has gradient norm 1 over all space (unlike a cylinder, its ends are round, so it has no corners and is exact). Suited to approximating ribs, piping, bones, wires and the swept volume of a tool.

Arguments and validation (ValueError):

• grid: float array (..., 3) whose last axis is 3.

• a / b: end points of the core line (3 elements). If a == b it is a sphere (matches sphere_sdf).

• radius: thickness (negative is rejected).

Returns: float64 of shape grid.shape[:-1].

Where to use: to check tool reachability as "does the swept volume of the tool avoid the part?", place the tool as a capsule and check whether the minimum of sdf_intersect is positive. Also for synthesizing trabeculae, vessels and fibres.

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)

• procedural_hand — py -3.11 examples_3d/procedural_hand.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 · box_sdf · plane_sdf · cylinder_sdf · torus_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.