Open jdmarsh opened 8 months ago
I can reproduce the issue. Thanks.
The algorithm incorrectly generates the intersection segments using the computed intersection points and the original endpoints of the input segment. Note that if you compute the intersection points (instead of intersection segments) you will get a good approximation. i.e. std::vector<Point2D> intersections
I have a polygon and line which intersects at the very corner, the intersection result is much larger than it should be. The godbolt repro is here: https://godbolt.org/z/TEEaqvcT1
Polygon(red) and line(green)
Intersection result(blue) goes way outside of the red triangle, down to the bottom left
I don't really care whether the actual result is super accurate or not, I don't need a high level of precision, I just need the result to be somewhat sensible and not creating huge lines outside the boundaries of the polygons I'm using to intersect.