Open mjagodicblackshark opened 1 year ago
I've had this issue crop up as well (1.82 and 1.83). It's not quite the same but I've added a repro of my problem here: https://godbolt.org/z/W1s7YEczP with the points plotted here: https://www.desmos.com/calculator/zrytxj5d8u The output line should be very small as it only intersects at a corner, but the output seems to be much much larger going outside of the bounds of the polygon.
I can reproduce the issue. Probably a numerical issue. With double
instead of float
the results are as expected.
I've had this issue using float and double. I only managed to solve it by moving to cpp_bin_float_quad in boost multiprecision but that's crazy slow and I can't guarantee that the issue isn't still going to crop up there as well, I just haven't seen it yet.
@jdmarsh could you please open a new issue with your example and data?
On version 1.82 without special defines. I have found a test case that gives unexpectedly wrong results.
Here is the test case to prove the problem. The correct result is close to the float precision limit, but the actual result is almost the same as one of the input polygons and therefore very wrong. Empty or even degenerate results would be fine for our use case. Possibly related to #1201
polygon1-orange, polygon2-red the result of the intersection