fit_cone — 3D robust_fit op

• Data kinds: points → primitive

• Call: import fullseye as fs; fs.ledger.fit_cone(points) -> 'dict' (to call the implementation directly, import fit_primitives_ext; fit_primitives_ext.fit_cone(points) -> 'dict'; from the registry, ops3d.get("fit_cone"))

Usage

Fit an infinite cone to a point set and return {apex, axis, half_angle, residual}.

Minimises the point-to-generatrix orthogonal distance in the meridian plane, a·sinα − ρ·cosα (a = axial component, ρ = radius, α = half-angle), with scipy.optimize.least_squares. The initial value tries each of the 3 PCA principal axes as the axis candidate and takes a linear regression ρ = m·t + b of the radius ρ against the axial component t (half-angle = atan(m), apex = the point on the axis where ρ becomes 0, t = -b/m). The candidate with the smallest residual is kept. The axis orientation is normalised so that "ρ grows away from the apex (opens toward +)".

Args:

points: (N,3) point cloud (at least 6 points).

Returns:

dict: {"apex": (3,), "axis": (3,), "half_angle": float, "residual": float}.

axis is the unit axis (opening direction), half_angle the half-angle [rad], residual the RMS of point-surface distance.

Raises:

ValueError: fail-closed on bad shape / too few points / half-angle ~0 (degenerates to a cylinder), etc.

Background guides (the physics and conventions behind this op)

• blas_threads_and_memory — Why matrix decompositions are slow — BLAS threads, caches, memory layout

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

Runnable examples (verified samples that actually call this op)

• fit_primitives_ext — py -3.11 examples_3d/fit_primitives_ext.py

Ops the type connects to (they accept primitive as 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

Same category (robust_fit)

ransac_plane · ransac_sphere · ransac_line · ransac_cylinder · fit_torus · fit_ellipsoid


*Provenance: fit_primitives_ext.py — 3D operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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