Page MenuHome

Fix T60935: More numerically stable distance to ray computation
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Feb 5 2019, 1:04 PM.

Details

Summary

I'm not even sure if the older algorithm computed the correct result.
In any case it was numerically very unstable for 2 reasons:
computing the square and then subtracting the results.

In the example in T60935 all precision was lost and it returned the distance 0
for all points.

It might make sense to remove the other algorithm since it is not used anywere.
Also maybe some code can be shared with the dist_squared_to_line_XXX
functions.

I also removed the depth parameter since it wasn't used and computing
it would have made the code more complicated.

Diff Detail

Repository
rB Blender
Branch
stable-projection (branched from master)
Build Status
Buildable 2845
Build 2845: arc lint + arc unit

Event Timeline

The old one should be removed, so we don't run into the same precision issue again.

Otherwise looks good to me.

+1 to remove old function too.

This revision is now accepted and ready to land.Feb 6 2019, 3:32 AM
This revision was automatically updated to reflect the committed changes.