geometry oppoints → primitiveimport fullseye as fs; fs.ledger.fit_sphere_3d(points) (実装を直接呼ぶなら import match3d; match3d.fit_sphere_3d(points)、台帳から引くなら ops3d.get("fit_sphere_3d"))点群 → 最小二乗球(代数フィット)。返り値 (center, radius)。配管/ボール計測に。
|p|² = 2c·p + (r² − |c|²) を [2p, 1] の線形最小二乗(lstsq)で解く代数フィット
(幾何距離の最小化ではないので、球の一部しか見えていない・ノイズが大きいと半径が偏る)。
(N,3) で 4 点未満は ValueError。radius は sqrt(max(s + |c|², 0)) で負は 0 に clamp。
点が同一平面上・共線だと lstsq の最小ノルム解が黙って返る(検証は無い。残差も返さないので
|p − c| − r で確かめる)。
幾何距離で追い込むなら本 op の結果を初期値にして非線形最小二乗、外れ値には ransac_sphere。
voxel からの検出は hough_sphere_3d。
py -3.11 examples_3d/geometry_metrology.pyprimitive を入力に取れる)fuse_to_voxel · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line · distance_line_line · distance_segment_segment
geometry)line_from_2points · plane_from_3points · angle_3points · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line
Provenance: match3d.py — 3D operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.