{"id":19097230,"url":"https://github.com/lycantropos/bentley_ottmann","last_synced_at":"2025-04-30T14:29:54.285Z","repository":{"id":53172511,"uuid":"234735553","full_name":"lycantropos/bentley_ottmann","owner":"lycantropos","description":"Detection of line segments \u0026 polygon edges intersections","archived":false,"fork":false,"pushed_at":"2023-11-13T09:20:55.000Z","size":332,"stargazers_count":17,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T14:29:46.664Z","etag":null,"topics":["bentley-ottmann","shamos-hoey","sweep-line-algorithm"],"latest_commit_sha":null,"homepage":"https://bentley-ottmann.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lycantropos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-18T13:02:54.000Z","updated_at":"2024-04-08T16:52:22.000Z","dependencies_parsed_at":"2024-06-21T20:22:34.775Z","dependency_job_id":"bba2e92a-af3d-4d0b-9f6f-838c6690b1f3","html_url":"https://github.com/lycantropos/bentley_ottmann","commit_stats":{"total_commits":458,"total_committers":1,"mean_commits":458.0,"dds":0.0,"last_synced_commit":"67b00529c2494f94f26007e831bda09622c57579"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2Fbentley_ottmann","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2Fbentley_ottmann/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2Fbentley_ottmann/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lycantropos%2Fbentley_ottmann/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lycantropos","download_url":"https://codeload.github.com/lycantropos/bentley_ottmann/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251721323,"owners_count":21632808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bentley-ottmann","shamos-hoey","sweep-line-algorithm"],"created_at":"2024-11-09T03:39:31.009Z","updated_at":"2025-04-30T14:29:54.261Z","avatar_url":"https://github.com/lycantropos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"bentley_ottmann\n===============\n\n[![](https://github.com/lycantropos/bentley_ottmann/workflows/CI/badge.svg?branch=master)](https://github.com/lycantropos/bentley_ottmann/actions/workflows/ci.yml \"Github Actions\")\n[![](https://readthedocs.org/projects/bentley_ottmann/badge/?version=latest)](https://bentley-ottmann.readthedocs.io/en/latest \"Documentation\")\n[![](https://codecov.io/gh/lycantropos/bentley_ottmann/branch/master/graph/badge.svg)](https://codecov.io/gh/lycantropos/bentley_ottmann \"Codecov\")\n[![](https://img.shields.io/github/license/lycantropos/bentley_ottmann.svg)](https://github.com/lycantropos/bentley_ottmann/blob/master/LICENSE \"License\")\n[![](https://badge.fury.io/py/bentley-ottmann.svg)](https://badge.fury.io/py/bentley-ottmann \"PyPI\")\n\nIn what follows `python` is an alias for `python3.7` or `pypy3.7`\nor any later version (`python3.8`, `pypy3.8` and so on).\n\nInstallation\n------------\n\nInstall the latest `pip` \u0026 `setuptools` packages versions\n```bash\npython -m pip install --upgrade pip setuptools\n```\n\n### User\n\nDownload and install the latest stable version from `PyPI` repository\n```bash\npython -m pip install --upgrade bentley_ottmann\n```\n\n### Developer\n\nDownload the latest version from `GitHub` repository\n```bash\ngit clone https://github.com/lycantropos/bentley_ottmann.git\ncd bentley_ottmann\n```\n\nInstall dependencies\n```bash\npython -m pip install -r requirements.txt\n```\n\nInstall\n```bash\npython setup.py install\n```\n\nUsage\n-----\n\nWith segments\n```python\n\u003e\u003e\u003e from ground.base import get_context\n\u003e\u003e\u003e context = get_context()\n\u003e\u003e\u003e Point, Segment = context.point_cls, context.segment_cls\n\u003e\u003e\u003e unit_segments = [Segment(Point(0, 0), Point(1, 0)), \n...                  Segment(Point(0, 0), Point(0, 1))]\n\n```\nwe can check if they intersect\n```python\n\u003e\u003e\u003e from bentley_ottmann.planar import segments_intersect\n\u003e\u003e\u003e segments_intersect(unit_segments)\nTrue\n\n```\n\nWith contours\n```python\n\u003e\u003e\u003e Contour = context.contour_cls\n\u003e\u003e\u003e triangle = Contour([Point(0, 0), Point(1, 0), Point(0, 1)])\n\u003e\u003e\u003e degenerate_triangle = Contour([Point(0, 0), Point(2, 0), Point(1, 0)])\n\n```\nwe can check if they are self-intersecting or not\n```python\n\u003e\u003e\u003e from bentley_ottmann.planar import contour_self_intersects\n\u003e\u003e\u003e contour_self_intersects(triangle)\nFalse\n\u003e\u003e\u003e contour_self_intersects(degenerate_triangle)\nTrue\n\n```\n\nDevelopment\n-----------\n\n### Bumping version\n\n#### Preparation\n\nInstall\n[bump2version](https://github.com/c4urself/bump2version#installation).\n\n#### Pre-release\n\nChoose which version number category to bump following [semver\nspecification](http://semver.org/).\n\nTest bumping version\n```bash\nbump2version --dry-run --verbose $CATEGORY\n```\n\nwhere `$CATEGORY` is the target version number category name, possible\nvalues are `patch`/`minor`/`major`.\n\nBump version\n```bash\nbump2version --verbose $CATEGORY\n```\n\nThis will set version to `major.minor.patch-alpha`. \n\n#### Release\n\nTest bumping version\n```bash\nbump2version --dry-run --verbose release\n```\n\nBump version\n```bash\nbump2version --verbose release\n```\n\nThis will set version to `major.minor.patch`.\n\n### Running tests\n\nInstall dependencies\n```bash\npython -m pip install -r requirements-tests.txt\n```\n\nPlain\n```bash\npytest\n```\n\nInside `Docker` container:\n- with `CPython`\n  ```bash\n  docker-compose --file docker-compose.cpython.yml up\n  ```\n- with `PyPy`\n  ```bash\n  docker-compose --file docker-compose.pypy.yml up\n  ```\n\n`Bash` script:\n- with `CPython`\n  ```bash\n  ./run-tests.sh\n  ```\n  or\n  ```bash\n  ./run-tests.sh cpython\n  ```\n\n- with `PyPy`\n  ```bash\n  ./run-tests.sh pypy\n  ```\n\n`PowerShell` script:\n- with `CPython`\n  ```powershell\n  .\\run-tests.ps1\n  ```\n  or\n  ```powershell\n  .\\run-tests.ps1 cpython\n  ```\n- with `PyPy`\n  ```powershell\n  .\\run-tests.ps1 pypy\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flycantropos%2Fbentley_ottmann","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flycantropos%2Fbentley_ottmann","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flycantropos%2Fbentley_ottmann/lists"}