cylinder_sdf — 3D sdf_csg op

• Data kinds: coordgrid → sdf

• Call: import fullseye as fs; fs.ledger.cylinder_sdf(grid, center, axis, radius, height) (implementation को सीधे call करना हो तो import sdf_ops; sdf_ops.cylinder_sdf(grid, center, axis, radius, height), registry से लेना हो तो ops3d.get("cylinder_sdf"))

उपयोग

सीमित लंबाई वाले cylinder (दोनों सिरों पर सपाट ढक्कन) का exact signed distance field (अंदर ऋणात्मक, बाहर धनात्मक)।

axial दूरी t और axis से radius r में बाँटकर q = (r - radius, |t| - height/2) रखते हैं, और outside = ‖max(q, 0)‖, inside = min(max(q), 0), sdf = outside + inside। यह box_sdf वाली Quilez-शैली की रचना को "(radius, axis) के 2-D cross-section" पर लागू करना है, इसलिए side, caps और कोनों (rims) सभी के लिए यह सच्ची Euclidean distance होती है।

Arguments और validation (ValueError):

• grid: अंतिम axis 3 वाला float array (..., 3)।

• center: cylinder का center (end face नहीं बल्कि centroid; 3 elements)।

• axis: axis की दिशा (3 elements, zero vector और NaN अस्वीकार; लंबाई अपने-आप normalise)।

• radius: radius > 0 के बराबर scalar (0 स्वयं axis line है, negative अस्वीकार)।

• height: पूरी लंबाई का scalar (center से ±height/2; negative अस्वीकार)।

Return value: grid.shape[:-1] का float64।

कहाँ उपयोग करें: through hole के लिए sdf_subtract(part, cylinder_sdf(...)) (height को part से लंबा रखें ताकि end face का rim न बचे)। boss, pin और shaft के लिए sdf_union। अनंत लंबा cylinder चाहिए तो height को पर्याप्त बड़ा लें (end faces evaluation क्षेत्र से बाहर हों तो केवल side का असर रहता है)।

संदर्भ (sample data, साहित्य)

• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।

• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।

चलाए जा सकने वाले उदाहरण (verified samples जो सच में यह op call करते हैं)

• sdf_csg — py -3.11 examples_3d/sdf_csg.py

वे अगले ops जिनसे type जुड़ता है (sdf को input के रूप में लेते हैं)

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

इसी 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. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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