fit_line_3d — 3D geometry op

• Data kinds: points → primitive

• Call: import fullseye as fs; fs.ledger.fit_line_3d(points) (implementation को सीधे call करना हो तो import match3d; match3d.fit_line_3d(points), registry से लेना हो तो ops3d.get("fit_line_3d"))

उपयोग

point cloud → least squares line (point=centroid, direction=सबसे बड़ा principal axis)। return value (point, direction)।

(N,3) point cloud (संख्यात्मक न हो या column की संख्या 3 न हो तो ValueError, 2 से कम बिंदु भी ValueError) का centroid c और scatter matrix (P−c)ᵀ(P−c) के सबसे बड़े eigenvalue का eigenvector लौटाता है (orthogonal दूरियों के वर्गों का योग न्यूनतम करने वाली रेखा; z=f(x) प्रकार का regression नहीं)। direction unit vector है और चिह्न मनमाना है (eigh पर निर्भर; दिशा एक जैसी करनी हो तो (P[-1] − P[0]) @ direction के चिह्न से उलटें)। केवल 2 बिंदु हों तो 2 बिंदुओं से गुजरने वाली रेखा। बिंदु plane की तरह फैले हों तो सबसे बड़ा axis केवल "सबसे लंबी दिशा" होता है, ज़रूरी नहीं कि वह रेखा हो (residual नहीं लौटाया जाता, इसलिए distance_point_line से जाँचें)। outlier के प्रति संवेदनशील (robust के लिए ransac_line)। केवल 3-D (2-D बिंदु ValueError देते हैं)।

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

• geometry_metrology — py -3.11 examples_3d/geometry_metrology.py

वे अगले ops जिनसे type जुड़ता है (primitive को input के रूप में लेते हैं)

fuse_to_voxel · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line · distance_line_line · distance_segment_segment

इसी category के (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 note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*

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