geometry op• Data kinds: primitive → measurement
• Call: import fullseye as fs; fs.ledger.distance_segment_segment(p0, p1, q0, q1) (to call the implementation directly, import match3d; match3d.distance_segment_segment(p0, p1, q0, q1); from the registry, ops3d.get("distance_segment_segment"))
• Return value through the ledger: fullseye.ledger.distance_segment_segment(...) returns only the declared out type measurement (the underlying function also returns auxiliary values). When you need what was dropped, use fullseye.ledger.distance_segment_segment.raw(...) or call match3d.distance_segment_segment directly.
Shortest distance between finite line segments and the pair of their closest points. → (distance, cp, cq).
distance_line_line is the distance between infinite lines, so it can return 0 for 2 segments that are apart (measured: 0.0 for (0,0,0)-(1,0,0) and (5,0,0)-(6,0,0), ground truth 4.0). Limbs, robot links, pipes and tools are all finite, so for safety distances or interference checks the infinite-line version underestimates the danger (in the poc_safety_clearance measurement, an 87.6 % underestimate for the same 2 segments).
Args:
p0, p1: endpoints of segment 1, (3,). If p0 == p1 it is treated as a point.
q0, q1: endpoints of segment 2, (3,).
Returns:
(distance, cp, cq): the shortest distance as float, and the closest points on the segment-1 side and the segment-2 side,
(3,). distance == 0 when the 2 segments intersect (or touch).
★Via the ledger (fullseye.ledger.distance_segment_segment) only the declared out type
distance is returned. When you also need the closest points, use
fullseye.ledger.distance_segment_segment.raw(...).
Raises:
ValueError: when an endpoint cannot be converted to (3,), or is non-finite.
Parallel and degenerate cases (segments collapsed to a point) are also handled correctly by branching (Ericson, *Real-Time Collision Detection*, §5.1.9, clamped closest-point method). The distance between capsules (core line + radius) is distance - r1 - r2; interference means that it becomes negative.
Reference (public): C. Ericson, *Real-Time Collision Detection*, Morgan Kaufmann 2005, §5.1.9 "Closest Points of Two Line Segments".
• 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.
• geometry_metrology — py -3.11 examples_3d/geometry_metrology.py
measurement as input)vol_gaussian_psf · fuse_to_voxel · fresnel_reflectance · snell_angle
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.