Regarding outside corners, I'm using a slightly modified method than from the article. Rather than just one ray at each corner, I'm using two instead, at 0.1 degrees offset at each one so I'll get one that collides and one that doesn't.
For why I didn't cast at imagepoints, the second part of the example is where I experimented with that (Method 2: By coordinates). More issues popped up than via the first method, although they seem to be gone with the latest update.
I'll probably end up drawing individual triangles instead of one big poly. Although I avoided the self intersecting problem, other visual glitches popped up, I had another github post on that one.
Most of the expressions produce a default value of 0 if there was no hit, but for distance it could be because the ray was colliding with an object at it's origin position? More likely that there was no collision.
The issue here was that I didn't set the line's width to HitDistance unless there was a hit detected as the condition. So there was a hit, and it returned 0. I don't see it occur in R144 at all though.
With the update, both methods consistently behave as expected. So far so good, thanks!