-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Milestone
Description
Bug report
Bug summary
If I two paths has a common segment, the result of a.intersects_path(b)
is inconsistent. I think it should return True
every time in this case.
Code for reproduction
from matplotlib.path import Path
a = Path([(0,1),(0,3)])
b = Path([(0,0),(0,4)]) # larger than a
c = Path([(0,0),(0,2)]) # ends in a
d = Path([(0,1),(0,2),(0,3)]) # same as a, but has an extra point in a
e = Path([(0,0),(0,2),(0,4)]) # same as b, but has an extra point in a
f = Path([(0,0),(0,1),(0,3),(0,4)]) # contains a as a segment
g = Path([(0,1),(0,3),(1,3)]) # a and a non-collinear point
paths = [a,b,c,d,e,f, g]
for i in paths:
print([1 if p.intersects_path(i) else 0 for p in paths])
Actual outcome
[0, 0, 0, 0, 1, 1, 1]
[0, 0, 0, 0, 0, 0, 1]
[0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 1, 1, 1]
[1, 0, 0, 1, 0, 0, 1]
[1, 0, 0, 1, 0, 0, 1]
[1, 1, 0, 1, 1, 1, 1]
Expected outcome
True for all (since they all have the [(0,1),(0,2)]
segment in common).
Matplotlib version
- Operating system: Ubuntu 16.04
- Matplotlib version: 2.2.2
- Matplotlib backend (
print(matplotlib.get_backend())
): module://ipykernel.pylab.backend_inline - Python version: 3.6.5
- Jupyter version (if applicable): 5.4.1