Perpendicular chord lengths from the boundary points of an arbitary 2D shape

Let's generate an arbitrary convex domain with smooth boundaries:

Graphics[BSplineCurve[{{1, 4}, {5, 3}, {9, 4}, {5, 5}, {8, 7}},
SplineClosed -> True]]


I'd like to discretize the boundary and calculate the perpendicular distances from each point to the corresponding points across the boundary of the domain. Like in the following picture:

At first I thought it should be simple but after some time I couldn't come up with a proper solution. How would you do that? I'd appreciate any help!

• are the curves always parametric (as opposed to implicit) ? Feb 5, 2019 at 18:44
• No, it can be implicit as well. I used parametric points just for the representation. Feb 5, 2019 at 19:35

bsf = BSplineFunction[{{1, 4}, {5, 3}, {9, 4}, {5, 5}, {8, 7}}, SplineClosed -> True];
line = Cases[ParametricPlot[bsf[t], {t, 0, 1}] [[1]], _Line, All][[1]];

mesh = Range[0, 1, .1];
coords = Nearest[RegionIntersection[line,
InfiniteLine[{bsf[#], (bsf[#] + Cross[bsf'[#]])}]][[1]]][bsf[#], 2] & /@ mesh;

ParametricPlot[bsf[t], {t, 0, 1},
Frame -> True, ImageSize -> Large, Axes -> False, PlotRangePadding -> 1, AspectRatio -> 1,