Java cli tool to draw Voronoi diagrams && An optimization Algorithm based on Lloyd Algorithm.
Reused this code and added a workaround to handle sites having the same y coordinate.
The provided diagram may not be 100% accurate in case of two sites having the same y coordinate
This library also prints all of voronoi cells points in stdout.
- JDK 1.8
- Python 3.8
git clone https://github.com/Gabz18/voronoi-generator.git
cd voronoi-generator
mkdir classes
javac -d classes src/generator/*.java
cd ./classes && jar cfve ../VoronoiGenerator.jar generator.Main . && cd ../
Arguments :
- width : -w $doubleValue, Required
- height : -h $doubleValue, Required
- site : -s $xDoubleValue:$yDoubleValue, At least one
- Dont show diagram: --no-display
- Sensor coverage radius : -s $doubleValue
java -jar VoronoiGenerator.jar -h 500.0 -w 500.0 -s 45.3:250.3 -s 260:350 -s 400:149.6
- Build the voronoi generator Jar
- python python/voronoi_relaxation.py