pub fn point_to_segment(p: Point3, seg_a: Point3, seg_b: Point3) -> f64
Closest point on a 3D segment to point p (treating segment as 3D using z=0 for Point2).