boostorg / boostorg/geometry

Intersection gives incorrect result for polygon and line

Open
#1,253 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
517
Forks
232
PR merge metrics
No merged PRs in 30d

Description

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)
![image](https://github.com/boostorg/geometry/assets/972442/a83f8c87-7ddd-40e8-b08a-4688f48d9f1b)

Intersection result(blue) goes way outside of the red triangle, down to the bottom left
![image](https://github.com/boostorg/geometry/assets/972442/6f1a9165-e1a6-40d5-982c-1a2b01d7007c)

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.