Skip to content

Inconsistent path intersection #11527

@firesharker

Description

@firesharker

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy