capsule_sdf — 3D sdf_csg op

資料種類:coordgridsdf

呼叫: import fullseye as fs; fs.ledger.capsule_sdf(grid, a, b, radius)(要直接呼叫實作,import sdf_ops; sdf_ops.capsule_sdf(grid, a, b, radius);從台帳取用則 ops3d.get("capsule_sdf"))

用法

> 該運算子的說明尚無譯文,以下照原文給出。

線分 `ab を半径 radius` で太らせたカプセルの厳密な符号付き距離場。

`sdf(p) = ‖p - (a + clamp(((p-a)·(b-a))/‖b-a‖², 0, 1)·(b-a))‖ - radius`。

線分への最短距離そのものなので全空間で勾配ノルム 1(円柱と違い端が丸いぶん、

角が無く厳密)。リブ・配管・骨・ワイヤ・工具の掃引体積の近似に向く。

引数と検証(`ValueError`):

• `grid: 最終軸が 3 の float 配列 (..., 3)`。

• `a / b: 芯線の端点(要素数 3)。a == b なら球(sphere_sdf` と一致)。

• `radius`: 太さ(負は拒否)。

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

使いどころ: 工具の到達性を「工具の掃引体積が部品と交わらないか」で見るとき、工具を

カプセルで置いて `sdf_intersect` の最小値が正かを見る。骨梁・血管・繊維の合成にも。

參考(範例資料・文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

procedural_handpy -3.11 examples_3d/procedural_hand.py

sdf_csgpy -3.11 examples_3d/sdf_csg.py

型別可銜接的下一個運算子(可接受 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 · cylinder_sdf · torus_sdf · sdf_union · sdf_intersect


*Provenance: sdf_ops.py — 3D 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

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