torus_sdf — 3D sdf_csg op

• Data kinds: coordgrid → sdf

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

उपयोग

torus (doughnut) का exact signed distance field (अंदर ऋणात्मक, बाहर धनात्मक)।

sdf(p) = ‖(r - major_radius, t)‖ - minor_radius (r axis से radius है, t axial दूरी)। core line radius major_radius का circle है और उसके चारों ओर radius minor_radius की tube लगी है, इसलिए इसे सीधे fillet (अंदरूनी कोने की गोलाई) के analytic रूप में उपयोग कर सकते हैं।

Arguments और validation (ValueError):

• grid / center / axis: cylinder_sdf जैसे ही (axis donut के छेद की दिशा है)।

• major_radius: core line का radius (negative अस्वीकार)।

• minor_radius: tube का radius (negative अस्वीकार)। minor_radius >= major_radius होने पर छेद पिचक जाता है (spindle torus)। इसे अस्वीकार नहीं किया जाता, पर exact केवल minor_radius < major_radius होने पर है (2026-10-07 सुधार: पहले लिखा था "distance field के रूप में सही है")। अंदर, जहाँ tube axis पर स्वयं से overlap करती है, मान का absolute value boundary तक की सच्ची दूरी से छोटा होता है (major 1, minor 2 के center पर −1, ground truth −1.73)। sign, zero isosurface और बाहर के मान सही हैं, और अंदर का absolute value सच्ची दूरी की lower bound है, इसलिए sphere tracing के लिए इसका सुरक्षित उपयोग किया जा सकता है।

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

कहाँ उपयोग करें: sdf_subtract से अंदरूनी कोने में fillet काटना / sdf_union से O-ring groove का आकार बनाना। केवल कोने गोल करने हों तो sdf_smooth_union आसान है, पर उसमें गोलाई का radius आकार पर निर्भर करता है -- radius को design value के रूप में रखना हो तो यह वाला।

संदर्भ (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 · cylinder_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.