The two most common point in polygon test methods (Ray casting method and Winding number method) does not work in my case, when the polygon looks like below: As you can see, the polygon is splitted by the boundaries of coordinate system. Points A and B are inside, C is outside. All of the methods posted in other threads failed for such polygon. Any idea or a good algorithm? A working C# implementation would be really helpful!
0
votes
1 Answers
0
votes
In the meantime I've found the solution.
But first a better visualization of the problem, below is the polygon displayed on the surface of a cylinder, where the vertical dashed line represent both beginning and end of X coordinate range of values:
The original polygon must be divided into 2 subpolygons by the coordinate system boundary "line" and algorithm must be executed on those 2 subpolygons.
For drawing or any visualization however still the original polygon must be used.