New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

poly_decomp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poly_decomp

Decompose 2D polygons into convex pieces.

pipPyPI
Version
0.0.1
Maintainers
1

poly_decomp.py: Decompose 2D polygons into convex pieces

.. image:: https://img.shields.io/pypi/v/poly_decomp.svg :target: https://pypi.python.org/pypi/poly_decomp

Installation

.. code-block:: bash

$ pip install poly_decomp

Usage

.. code-block:: python

import poly_decomp as pd

polygon = [[0, 0], [5, 0], [5, 5], [2.5, 2.5], [0, 5]]
#           |\    /| 
#           | \  / |
#           |  \/  |
#           |      |
#           |------|

print pd.polygonDecomp(polygon)
# --> [[[0, 0], [2.5, 2.5], [0, 5]], [[0, 0], [5, 0], [5, 5], [2.5, 2.5]]]
#           |\   /| 
#           | \ / |
#           |  /  |
#           | /   |
#           |/----|

print pd.polygonQuickDecomp(polygon)
# --> [[[5, 0], [5, 5], [2.5, 2.5]], [[2.5, 2.5], [0, 5], [0, 0], [5, 0]]]
#           |\   /| 
#           | \ / |
#           |  \  |
#           |   \ |
#           |----\|

About

Implementation based on Schteppe's <http://steffe.se>_ poly-decomp.js <https://github.com/schteppe/poly-decomp.js>_.

Algorithms based on Mark Bayazit's <http://mpen.ca>_ Poly Decomp <https://mpen.ca/406/bayazit>_.

.. :changelog:

Release History

dev +++

0.0.1 (2016-10-25) +++++++++++++++++++

  • Initial release.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts