distance_line_line — 3D geometry op

• Data kinds: primitive → measurement

• Call: import fullseye as fs; fs.ledger.distance_line_line(p1, d1, p2, d2) (to call the implementation directly, import match3d; match3d.distance_line_line(p1, d1, p2, d2); from the registry, ops3d.get("distance_line_line"))

Usage

The distance between two lines (skew lines included). Falls back to point-line distance when they are parallel.

★This is the distance between infinite lines. Applied to finite segments such as limbs, robot links or pipes, it can return 0 even when they are apart (measured: (0,0,0)-(1,0,0) and (5,0,0)-(6,0,0) give 0.0, ground truth 4.0). For pairs of segments use distance_segment_segment — confusing the two in a safety-distance check errs on the side that underestimates the danger.

Takes n = d̂1 × d̂2; if |n| < 1e-9 (parallel) it returns distance_point_line(p2, p1, d1), otherwise |(p2 − p1)·n̂| (length of the common perpendicular) as a float. 0 for intersecting lines. p1, d1, p2, d2 are numeric 2- or 3-vectors; mixed dimensions raise ValueError. Non-parallel lines in 2-D intersect, so the distance should be 0, but np.cross becomes a scalar and @ fails (in 2-D only the parallel case goes through). Use it in 3-D. Units are those of the input coordinates.

Uses: coaxiality of 2 axes (fit_line_3d), hole pitch.

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)

• geometry_metrology — py -3.11 examples_3d/geometry_metrology.py

Ops the type connects to (they accept measurement as input)

vol_gaussian_psf · fuse_to_voxel · fresnel_reflectance · snell_angle

Same 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. 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.