in reply to Polygon interact other polygon
There are problematic cases where your test line goes straight through a vertex. You could think up an elaborate advanced scheme, taking the direction of the crossing into account, and counting such a crossing as +0.5 or -0.5 depending on its direction; or you could simply try again with a different line.
Combine this with tests on whether any edges from the polygons actually cross, and the basis is set.
|
|---|