René's URL Explorer Experiment


Title: Issue detecting paths intersection with Path.intersects_path · Issue #6076 · matplotlib/matplotlib · GitHub

Open Graph Title: Issue detecting paths intersection with Path.intersects_path · Issue #6076 · matplotlib/matplotlib

X Title: Issue detecting paths intersection with Path.intersects_path · Issue #6076 · matplotlib/matplotlib

Description: Short Description I think there may be a bug in the Path.intersects_path method, in path module: Signature: Path.intersects_path(self, other, filled=True) Docstring: Returns *True* if this path intersects another given path. *filled*, wh...

Open Graph Description: Short Description I think there may be a bug in the Path.intersects_path method, in path module: Signature: Path.intersects_path(self, other, filled=True) Docstring: Returns *True* if this path int...

X Description: Short Description I think there may be a bug in the Path.intersects_path method, in path module: Signature: Path.intersects_path(self, other, filled=True) Docstring: Returns *True* if this path int...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/6076

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issue detecting paths intersection with Path.intersects_path","articleBody":"## Short Description\n\nI think there may be a bug in the `Path.intersects_path` method, in `path` module:\n\n``` python\nSignature: Path.intersects_path(self, other, filled=True)\nDocstring:\nReturns *True* if this path intersects another given path.\n\n*filled*, when True, treats the paths as if they were filled.\nThat is, if one path completely encloses the other,\n:meth:`intersects_path` will return True.\nFile:      ~/anaconda/lib/python2.7/site-packages/matplotlib/path.py\nType:      instancemethod\n```\n\nPlaying with it, I encountered **some cases where this method answers that the two paths are not intersecting, while after plotting them, they do** (see the example script and picture below). I still didn't have time to look into further (especially the C++ code that is wrapped by the method), but it seems to me that this behavior is not correct, is it?\n## Details\n- [X] Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)\n\nMatplotlib 1.5.1, with Python 2.7.11 (and IPython 4.0.1), on Linux (CentOS 7 or Manjaro)\n- [X] How did you install Matplotlib and Python (pip, anaconda, from source ...)\n\nAnaconda 2.4.0 (64-bit)\n- [X] If possible please supply a [Short, Self Contained, Correct, Example](http://sscce.org/)\n    that demonstrates the issue i.e a small piece of code which reproduces the issue\n    and can be run with out any other (or as few as possible) external dependencies.\n\n``` python\n# -*- coding: utf-8 -*-\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import PathPatch\nfrom matplotlib.path import Path\n\ncubic_bezier_codes = [Path.MOVETO, Path.CURVE4, Path.CURVE4, Path.CURVE4]\n\ndef plot_ctrls(verts, ax, label='',\n               ls='--', marker='o', ms=5, lw=1, alpha=0.6, color='Gray'):\n    \"\"\"Plot the control points of a Bezier curve (debugging purpose)\n    \"\"\"\n    ax.plot(*zip(*verts), ls=ls, lw=lw, color=color, ms=ms, marker=marker,\n            alpha=alpha, label=label)\n    return ax\n\n# For your viewing pleasure when plotting\ndetection_color = {True: \"OliveDrab\", False: \"Crimson\"}\n\nif __name__ == \"__main__\":\n    plt.ion()\n\n    # A dummy path to play with\n    verts_1 = [(0.5, 0.01), (0.21, 0.99), (0.99, 0.8), (0.99, 0.99)]\n    path_1 = Path(verts_1, cubic_bezier_codes)\n\n    # A path that does intersect with path_1 but for which the ad-hoc test\n    # method fails\n    verts_2a = [(0.5, 0.8), (0.5, 0.7), (0.6, 0.75), (0.56, 0.7)]\n    path_2a = Path(verts_2a, cubic_bezier_codes)\n\n    # Decreasing a bit the y-value of the last control point leads to a\n    # correct detection of path intersecting.\n    verts_2b = [(0.5, 0.8), (0.5, 0.7), (0.6, 0.75), (0.56, 0.6)]\n    path_2b = Path(verts_2b, cubic_bezier_codes)\n\n    # Plot everything to be sure\n    fig, (axA, axB) = plt.subplots(ncols=2, sharex=True, sharey=True)\n    title_prefix = \"path_1.intersects_path(path_2):\\n\"\n    for ax, p1, p2 in [(axA, path_1, path_2a), (axB, path_1, path_2b)]:\n        # Detect if the two paths intersect\n        detection = p1.intersects_path(p2)\n        ax.set_title(title_prefix + \"{}\".format(detection))\n\n        # Plot the two paths\n        patch_1 = PathPatch(p1, lw=2, fc='none', ec='CornFlowerBlue')\n        pc1 = ax.add_patch(patch_1)\n        patch_2 = PathPatch(p2, lw=2, fc='none', ec=detection_color[detection])\n        ax.add_patch(patch_2)\n\n        # Plot the controls nodes for debugging\n        ax = plot_ctrls(p1.vertices, ax, marker='s', color=patch_1.get_ec(),\n                        label='verts_1')\n        ax = plot_ctrls(p2.vertices, ax, color=patch_2.get_ec(),\n                        label='verts_2')\n        ax.legend(loc='lower right', handlelength=3.5)\n\n    #fig.savefig(\"Issue_with_intersecting_path_detection.png\", dpi=150)\n\n```\n- [X] If this is an image generation bug attach a screenshot demonstrating the issue.\n\nThe paths are plotted in solid lines, and the vertices (control points) of the paths are plotted with markers (with thin dashed lines between them, and of the same color as the path they correspond to).\n- _Left panel_: the red path (path_2) is indicated as non intersecting with the blue one (path_1) by `path_1.intersects_path(path_2)`, while from the plot they seem to be intersecting… \n- _Right panel_: the green path (path_2) is indicated as intersecting with the blue one (path_1) by `path_1.intersects_path(path_2)`, which seems correct from the plot… \n\nThe only difference between the two red and green paths is their last control point (on the right), which is a bit lower in the right panel case than in the left panel case.\n\n![issue_with_intersecting_path_detection](https://cloud.githubusercontent.com/assets/17270724/13394989/2136ff0a-deec-11e5-8f0e-51cc0ed44fcb.png)\n- [X] If this is a regression (Used to work in an earlier version of Matplotlib), please \n    note where it used to work.\n\nNever used `Path.intersects_path` method before, so I can't tell if it's a regression.\n","author":{"url":"https://github.com/afvincent","@type":"Person","name":"afvincent"},"datePublished":"2016-02-29T13:28:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/6076/matplotlib/issues/6076"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:da8e4f95-be58-a634-59d0-1d93be69c9ea
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBD28:135646:835568:B1F4D1:6A52AB40
html-safe-nonce2e0e07c95a2b7fa22312ea9c865266cec8c72cd706afc5522f2e7f04947a840f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDI4OjEzNTY0Njo4MzU1Njg6QjFGNEQxOjZBNTJBQjQwIiwidmlzaXRvcl9pZCI6IjM4OTYxMjk1NzM3NTEwMDgwNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc3651ce3c756329da60d2e72e856af108738e31dcf2a01018670d70c8b6e8915
hovercard-subject-tagissue:137254468
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/6076/issue_layout
twitter:imagehttps://opengraph.githubassets.com/028f57368f94936c851a36b96de79c105c4ccddee9636d1f53ea08f16115f4b4/matplotlib/matplotlib/issues/6076
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/028f57368f94936c851a36b96de79c105c4ccddee9636d1f53ea08f16115f4b4/matplotlib/matplotlib/issues/6076
og:image:altShort Description I think there may be a bug in the Path.intersects_path method, in path module: Signature: Path.intersects_path(self, other, filled=True) Docstring: Returns *True* if this path int...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameafvincent
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/6076#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F6076
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F6076
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/6076
Reloadhttps://github.com/matplotlib/matplotlib/issues/6076
Reloadhttps://github.com/matplotlib/matplotlib/issues/6076
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/6076
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/6076
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Issue detecting paths intersection with Path.intersects_pathhttps://github.com/matplotlib/matplotlib/issues/6076#top
https://github.com/mdboom
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.https://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20closed%20as%20inactive%22
status: inactiveMarked by the “Stale” Github Actionhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20inactive%22
topic: path handlinghttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20path%20handling%22
future releaseshttps://github.com/matplotlib/matplotlib/milestone/25
https://github.com/afvincent
afvincenthttps://github.com/afvincent
on Feb 29, 2016https://github.com/matplotlib/matplotlib/issues/6076#issue-137254468
Short, Self Contained, Correct, Examplehttp://sscce.org/
https://cloud.githubusercontent.com/assets/17270724/13394989/2136ff0a-deec-11e5-8f0e-51cc0ed44fcb.png
mdboomhttps://github.com/mdboom
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.https://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20closed%20as%20inactive%22
status: inactiveMarked by the “Stale” Github Actionhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22status%3A%20inactive%22
topic: path handlinghttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20path%20handling%22
future releasesNo due datehttps://github.com/matplotlib/matplotlib/milestone/25
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.