I think the real-world situation may be more complex than what we’ve seen here so far.
I took a look at the links that @SLW210 attached and decided to test the Lisp codes proposed up to this point.
I looked through my drawings for something that could serve as an example for this problem, but it was like looking for a needle in a haystack.
So, in the end, I decided to look for something in the real world that clearly corresponds to this issue — something like this:
So I drew those margins and tested all the codes that have appeared in this thread so far.
The result was… this!
In the drawing, you can see the ones that managed to reach the end.
However, the codes by BIGAL, GP_, GLAVCVS, and MarkoRibar couldn't even do that.
Here’s the drawing
AxisExple4.dwg