Last updated:
0 purchases
poly decomp 0.0.1
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.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.