cylinder_sdf — 3D sdf_csg op

数据种类:coordgridsdf

调用: import fullseye as fs; fs.ledger.cylinder_sdf(grid, center, axis, radius, height)(要直接调用实现,import sdf_ops; sdf_ops.cylinder_sdf(grid, center, axis, radius, height);从台账取用则 ops3d.get("cylinder_sdf"))

用法

> 该算子的说明尚无译文,以下照原文给出。

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

軸方向の距離 `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: 最終軸が 3 の float 配列 (..., 3)`。

• `center`: 円柱の中心(端面ではなく重心。要素数 3)。

• `axis`: 軸の向き(要素数 3、零ベクトル・NaN は拒否。長さは自動正規化)。

• `radius: 半径 > 0 相当のスカラ(0` は軸線そのもの、負は拒否)。

• `height: 全長のスカラ(center` から ±height/2。負は拒否)。

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

使いどころ: **貫通穴は `sdf_subtract(part, cylinder_sdf(...))**(height` を部品より

長くして端面の縁を残さない)。ボス・ピン・シャフトは `sdf_union`。無限長の円柱が

要るなら `height` を十分大きく取る(端面が評価域の外に出れば側面だけが効く)。

参考(示例数据・文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

可运行的示例(实际调用该算子并已验证的样例)

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 · torus_sdf · capsule_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.