{"id":13748093,"url":"https://github.com/typemytype/booleanOperations","last_synced_at":"2025-05-09T10:32:14.189Z","repository":{"id":11775827,"uuid":"14314043","full_name":"typemytype/booleanOperations","owner":"typemytype","description":"Boolean operations on paths","archived":false,"fork":false,"pushed_at":"2022-10-30T07:37:57.000Z","size":465,"stargazers_count":39,"open_issues_count":13,"forks_count":18,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-28T21:45:49.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/typemytype.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"typemytype"}},"created_at":"2013-11-11T21:35:22.000Z","updated_at":"2024-11-03T14:59:42.000Z","dependencies_parsed_at":"2022-09-26T18:00:57.073Z","dependency_job_id":null,"html_url":"https://github.com/typemytype/booleanOperations","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typemytype%2FbooleanOperations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typemytype%2FbooleanOperations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typemytype%2FbooleanOperations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typemytype%2FbooleanOperations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typemytype","download_url":"https://codeload.github.com/typemytype/booleanOperations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253234178,"owners_count":21875561,"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":[],"created_at":"2024-08-03T07:00:34.216Z","updated_at":"2025-05-09T10:32:13.760Z","avatar_url":"https://github.com/typemytype.png","language":"Python","funding_links":["https://github.com/sponsors/typemytype"],"categories":["C++"],"sub_categories":[],"readme":"|Build Status| |PyPI| |Python Versions|\n\nBooleanOperations\n=================\n\nBoolean operations on paths which uses a super fast `polygon clipper\nlibrary by Angus Johnson \u003chttp://www.angusj.com/delphi/clipper.php\u003e`__.\n\nYou can download the latest version from PyPI:\n\nhttps://pypi.org/project/booleanOperations.\n\nInstall\n-------\n\n`Pip \u003chttps://pip.pypa.io/en/stable/\u003e`__ is the recommended tool to\ninstall booleanOperations.\n\nTo install the latest version:\n\n.. code:: sh\n\n    pip install booleanOperations\n\nBooleanOperations depends on the following packages:\n\n- `pyclipper \u003chttps://pypi.org/project/pyclipper/\u003e`__: Cython wrapper for\n  the C++ Clipper library\n- `fonttools \u003cgithub.com/behdad/fonttools\u003e`__\n\nAll dependencies are available on PyPI, so they will be resolved\nautomatically upon installing booleanOperations.\n\nBooleanOperationManager\n-----------------------\n\nContaining a ``BooleanOperationManager`` handling all boolean operations\non paths. Paths must be similar to ``defcon``, ``robofab`` contours. A\nmanager draws the result in a ``pointPen``.\n\n.. code:: py\n\n    from booleanOperations import BooleanOperationManager\n\n    manager = BooleanOperationManager()\n\nBooleanOperationManager()\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreate a ``BooleanOperationManager``.\n\nmanager.union(contours, pointPen)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nPerforms a union on all ``contours`` and draw it in the ``pointPen``.\n(this is a what a remove overlaps does)\n\nmanager.difference(contours, clipContours, pointPen)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nKnock out the ``clipContours`` from the ``contours`` and draw it in the\n``pointPen``.\n\nmanager.intersection(contours, clipContours, pointPen)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDraw only the overlaps from the ``contours`` with the\n``clipContours``\\ and draw it in the ``pointPen``.\n\nmanager.xor(contours, clipContours, pointPen)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDraw only the parts that not overlaps from the ``contours`` with the\n``clipContours``\\ and draw it in the ``pointPen``.\n\nmanager.getIntersections(contours)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nReturning all intersection for the given contours\n\nBooleanGlyph\n------------\n\nA glyph like object with boolean powers.\n\n.. code:: py\n\n    from booleanOperations.booleanGlyph import BooleanGlyph\n\n    booleanGlyph = BooleanGlyph(sourceGlyph)\n\nBooleanGlyph(sourceGlyph)\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nCreate a ``BooleanGlyph`` object from ``sourceGlyph``. This is a very\nshallow glyph object with basic support.\n\nbooleanGlyph.union(other)\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nPerform a **union** with the ``other``. Other must be a glyph or\n``BooleanGlyph`` object.\n\n.. code:: py\n\n    result = BooleanGlyph(glyph).union(BooleanGlyph(glyph2))\n    result = BooleanGlyph(glyph) | BooleanGlyph(glyph2)\n\nbooleanGlyph.difference(other)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nPerform a **difference** with the ``other``. Other must be a glyph or\n``BooleanGlyph`` object.\n\n.. code:: py\n\n    result = BooleanGlyph(glyph).difference(BooleanGlyph(glyph2))\n    result = BooleanGlyph(glyph) % BooleanGlyph(glyph2)\n\nbooleanGlyph.intersection(other)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nPerform a **intersection** with the ``other``. Other must be a glyph or\n``BooleanGlyph`` object.\n\n.. code:: py\n\n    result = BooleanGlyph(glyph).intersection(BooleanGlyph(glyph2))\n    result = BooleanGlyph(glyph) \u0026 BooleanGlyph(glyph2)\n\nbooleanGlyph.xor(other)\n^^^^^^^^^^^^^^^^^^^^^^^\n\nPerform a **xor** with the ``other``. Other must be a glyph or\n``BooleanGlyph`` object.\n\n.. code:: py\n\n    result = BooleanGlyph(glyph).xor(BooleanGlyph(glyph2))\n    result = BooleanGlyph(glyph) ^ BooleanGlyph(glyph2)\n\nbooleanGlyph.removeOverlap()\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nPerform a **union** on it self. This will remove all overlapping\ncontours and self intersecting contours.\n\n.. code:: py\n\n    result = BooleanGlyph(glyph).removeOverlap()\n\n--------------\n\nbooleanGlyph.name\n^^^^^^^^^^^^^^^^^\n\nThe **name** of the ``sourceGlyph``.\n\nbooleanGlyph.unicodes\n^^^^^^^^^^^^^^^^^^^^^\n\nThe **unicodes** of the ``sourceGlyph``.\n\nbooleanGlyph.width\n^^^^^^^^^^^^^^^^^^\n\nThe **width** of the ``sourceGlyph``.\n\nbooleanGlyph.lib\n^^^^^^^^^^^^^^^^\n\nThe **lib** of the ``sourceGlyph``.\n\nbooleanGlyph.note\n^^^^^^^^^^^^^^^^^\n\nThe **note** of the ``sourceGlyph``.\n\nbooleanGlyph.contours\n^^^^^^^^^^^^^^^^^^^^^\n\nList the **contours** of the glyph.\n\nbooleanGlyph.components\n^^^^^^^^^^^^^^^^^^^^^^^\n\nList the **components** of the glyph.\n\nbooleanGlyph.anchors\n^^^^^^^^^^^^^^^^^^^^\n\nList the **anchors** of the glyph.\n\n.. |Build Status| image:: https://api.travis-ci.org/typemytype/booleanOperations.svg\n   :target: https://travis-ci.org/typemytype/booleanOperations\n.. |PyPI| image:: https://img.shields.io/pypi/v/booleanOperations.svg\n   :target: https://pypi.org/project/booleanOperations/\n.. |Python Versions| image:: https://img.shields.io/badge/python-3.6,%203.7-blue.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypemytype%2FbooleanOperations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypemytype%2FbooleanOperations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypemytype%2FbooleanOperations/lists"}