fullseye

cylinder_sdf — 3D sdf_csg op

使い方

有限長の円柱(両端が平らな蓋)の厳密な符号付き距離場(内側負・外側正)。

軸方向の距離 t と軸からの半径 r に分け、q = (r - radius, |t| - height/2) として outside = ‖max(q, 0)‖inside = min(max(q), 0)sdf = outside + inside。 これは box_sdf と同じ Quilez 流の構成を「(半径, 軸)の 2-D 断面」に適用したもので、 側面・蓋・角(縁)のいずれに対しても真のユークリッド距離になる。

引数と検証(ValueError):

返り値: grid.shape[:-1] の float64。

使いどころ: 貫通穴は sdf_subtract(part, cylinder_sdf(...))(height を部品より 長くして端面の縁を残さない)。ボス・ピン・シャフトは sdf_union。無限長の円柱が 要るなら height を十分大きく取る(端面が評価域の外に出れば側面だけが効く)。

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(sdf を入力に取れる)

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

同カテゴリ(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 ノートは tools/opdocs.py md が自動生成(手編集しない)。

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