poly_decomp.py: Decompose 2D polygons into convex pieces
Installation
$ pip install poly_decomp
Usage
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 poly-decomp.js.
Algorithms based on Mark Bayazit’s Poly Decomp.
Release History
dev
0.0.1 (2016-10-25)
Initial release.
Metadata
Release files for poly_decomp 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| poly_decomp-0.0.1-py2-none-any.whl | Python 2 | none | any | Details for poly_decomp-0.0.1-py2-none-any.whl |
Release files / poly_decomp-0.0.1-py2-none-any.whl
| Download URL | poly_decomp-0.0.1-py2-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
9f7d86708d76ef2ee7fd8673f717f64be2657bf1b953246fad320cb70932a77e
|
|
BLAKE2b-256 checksum How to use checksums |
2607e13b055b2b3dbf01010737ee1c80ab047b1aabccb17124107cd05c326b4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for poly_decomp 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.