robust_fit op• 데이터 종류: points → primitive
• 호출: import fullseye as fs; fs.ledger.fit_torus(points, method: 'str' = 'exact', axis_parameterization: 'str' = 'cartesian') -> 'dict'(구현을 직접 호출하려면 import fit_primitives_ext; fit_primitives_ext.fit_torus(points, method: 'str' = 'exact', axis_parameterization: 'str' = 'cartesian') -> 'dict', 원장에서 가져오려면 ops3d.get("fit_torus"))
점군에 토러스를 적합해 {center, axis, R, r, residual} 을 돌려줍니다.
점-토러스 거리 sqrt((ρ−R)² + a²) − r(a=축 성분, ρ=축으로부터의 반지름, R=주반지름, r=관 반지름)를 scipy.optimize.least_squares로 최소화한다. 초기값은 PCA 축(혼자 다른 고유벡터) + R0=mean(ρ)·r0(관 중심원까지의 거리의 평균).
Args:
points: (N,3) 점군(최소 7 점).
method: 'exact'(기본)는 8개 파라미터를 한 번에 최소화한다. 'eliminate_r'는 관 반지름 r을 각 점에서 관 중심원까지 거리의 평균으로 소거하고 7개 파라미터만 최소화한다(더 빠른 대안. 기본값은 바꾸지 않으며 잔차 허용차는 rtol=1e-10, atol=1e-12).
axis_parameterization: 'cartesian'(기본)는 축을 3성분 벡터로 갱신한다. 'tangent'는 초기 축의 접평면 안의 2자유도로 축을 갱신하고 7개 파라미터만 최소화한다(더 빠른 대안. 시험한 점군에서 축의 차이는 1e-9 미만. method='eliminate_r'와는 함께 쓸 수 없다).
Returns:
dict: {"center": (3,), "axis": (3,), "R": float, "r": float, "residual": float}.
axis 는 단위 축, R 은 주반지름, r 은 관 반지름, residual 은 점-면 거리의 RMS.
Raises:
ValueError: 형상 부정/점 수 부족 시 fail-closed.
• blas_threads_and_memory — 행렬 분해가 느린 이유 — BLAS 스레드·캐시·메모리 배치
• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.
• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.
• fit_primitives_ext — py -3.11 examples_3d/fit_primitives_ext.py
primitive 를 입력으로 받는 것)fuse_to_voxel · angle_between_lines · angle_between_planes · angle_line_plane · distance_point_plane · distance_point_line · distance_line_line · distance_segment_segment
robust_fit)ransac_plane · ransac_sphere · ransac_line · ransac_cylinder · fit_cone · fit_ellipsoid
*Provenance: fit_primitives_ext.py — 3D 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.