-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
I have noticed that in some cases, calculating the intersection of two simple polygons can result in their complement. I have not delved deeply into the graph module to find out why this happens or produce other counterexamples, but here is a very simple one:
from spherical_geometry.polygon import SphericalPolygon
p1 = SphericalPolygon.from_cone(90, 0, 100)
p2 = SphericalPolygon.from_cone(270, 0, 100)
print(p1.contains_lonlat(0, 0)) # true
print(p2.contains_lonlat(0, 0)) # true
print(p1.intersection(p2).contains_lonlat(0, 0)) # erroneously false
I defined two caps on either side of the sphere whose intersection should be a thin strip around the prime meridian, or at very least empty if I've defined my polygons wrong.
Not sure why this is happening. I'll try and read through the graph module when I have time unless someone has an idea first. This may be related to #125; they mentioned something similar happening, but the consensus there seemed to be about self-intersection.
version 1.3.1
Metadata
Metadata
Assignees
Labels
No labels