cylinder_sdf — 3D sdf_csg op

• Data kinds: coordgrid → sdf

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

Usage

Exact signed distance field of a finite-length cylinder (flat caps at both ends) (negative inside, positive outside).

Split into the axial distance t and the radius from the axis r, set q = (r - radius, |t| - height/2), and take outside = ‖max(q, 0)‖, inside = min(max(q), 0), sdf = outside + inside. This applies the same Quilez-style construction as box_sdf to "the 2-D cross-section (radius, axis)", so it is the true Euclidean distance to the side, the caps and the corners (rims) alike.

Arguments and validation (ValueError):

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

• center: the center of the cylinder (the centroid, not an end face; 3 elements).

• axis: axis direction (3 elements, zero vector and NaN are rejected; length is normalised automatically).

• radius: scalar equivalent to radius > 0 (0 is the axis line itself, negative is rejected).

• height: scalar full length (±height/2 from center; negative is rejected).

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

Where to use: a through hole is sdf_subtract(part, cylinder_sdf(...)) (make height longer than the part so no rim of the end face remains). Bosses, pins and shafts use sdf_union. If you need an infinitely long cylinder, take height large enough (once the end faces are outside the evaluation domain, only the side matters).

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)

• 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 · 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.