sphere_sdf — 3D sdf_csg op

• Data kinds: coordgrid → sdf

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

उपयोग

sphere का signed distance field: |p - center| - R (अंदर ऋणात्मक, बाहर धनात्मक)।

grid अंतिम axis 3 वाला coordinate array (..., 3) है (grid_coords का output या (N,3) point cloud)। center की लंबाई 3, R>=0 radius है। return value का shape grid.shape[:-1] है। exact SDF (gradient norm 1)। sdf_offset(sphere_sdf(g,c,R), r) == sphere_sdf(g,c,R+r)।

R < 0 या गलत आकार के grid / center पर ValueError आता है।

गणना: np.linalg.norm(grid - center, axis=-1) - R। coordinates की unit ही दूरी की unit बन जाती है (grid_coords के world coordinates दें तो world unit)। coordinates के components का क्रम grid के अंतिम axis का क्रम है (grid_coords के लिए (x, y, z)), और center भी उसी क्रम में।

arguments और validation (ValueError):

• grid: अंतिम axis 3 वाला float array (..., 3) (1-D (3,) भी चलता है। 0-D या अंतिम axis 3 के अलावा हो तो reject)।

• center: 3 elements (reshape(3) न हो सके तो numpy का ValueError)।

• R: float() से बदला जा सकने वाला scalar। rotation matrix जैसी चीज़ देने पर भी ValueError (यह argument radius है, pose नहीं)। R < 0 reject होता है, R = 0 center से distance field ही है।

return value: grid.shape[:-1] का float64 (grid_coords के output के लिए (nx, ny, nz))। center पर -R, surface पर 0, बाहर धनात्मक।

उपयोग: grid_coords से grid → sphere_sdf / box_sdf → sdf_union / sdf_subtract से CSG → <= 0 को occupied मानकर marching cubes (voxel_to_mesh को -sdf देकर iso=0 के समकक्ष isosurface)।

संदर्भ (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 करते हैं)

• 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

वे अगले 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 · box_sdf · plane_sdf · cylinder_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.