Closed AHorneffer closed 7 years ago
I found and added some code to detect intersections of the line-segments. Right now it raises a ValueError
if it detects an intersection in a hand-made polygon. Is that what we want it to do? Shall I push the code to the master branch?
P.S. another case of what can happen when line-segments intersect below:
I think raising an error is fine -- most such cases are probably accidental, anyway.
This is related to #200 and #144.
When using a hand-made mask with factor, one can define a polygon in which two of the edges of the polygon cross each other. In this case the "right" side of the edge goes from "inside" to "outside" (or vice versa), which the code in Factor cannot handle. See below for an example of such a pathologic case.
IMHO Factor doesn't really need to handle this "correctly", it would be enough if it can detect it and then complain to the user. (But right now I don't have a good idea how to detect that elegantly.)
P.S. Factor also gets confused if two non-neighboring points are on top of each other. (Neighboring points that are too close to each other get thrown out.)