2d polygons triangulation with earcut algorithm
csv file with polygon vertices coords in counterclock-wise ("x" first, "y" second, integers only
):
1, 0
1, 1
0, 1
0, 0
- If success, csv with triangulation:
3,0,1
1,2,3
- If fault, csv file with error only, for example:
ERROR: Incorrect input data
At first, do the following:
- clone repo
- move to project root folder
- execute following commands:
python -m venv env # setup new virtualenv
source env/bin/activate # activate new virtualenv
pip install -r requirements.txt # install all project requirements
- to run program, just run python script with two params:
python main.py -i 'in.csv' -o 'out.csv'
-t
- run tests, check out if block in main.py (Some autogen examples could be incorrect)
-a
- draw plot to check asymptote, check out if block in main.py
-g
- gui mode