Open grimsa opened 8 years ago
The issue is valid.
One of the triangles of edge pair (AB & EF) - B'BE falls partly outside of the polygon ABCDEF...... (part outside marked in red). In this case areaAdjacentToTriangle (e.g. 200, marked in grey) could be reduced by the amount marked in red (say, 50) and calculation could proceed. Note that in this case areaAdjacentToTriangle can sometimes be negative (when red area is larger than grey one) and that would be a valid case.
Currently edge pairs are discarded from the calculation, when any part of triangle1, trapezoid or triangle2 (within which a cut could be located) falls outside the actual polygon being split.
However some cuts might be valid and should be considered, as long as the area outside of the polygon is not included in the calculation.