Distance on free-form curve

Hello. I need script for GH - on free-form curve with distance perp box is. ( Similary BBradial for free form curve) Example from drawing Rhino


DistanceOnFree-FormCurve_re.gh (9.9 KB)