z3dev / poly-bool-comparison

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a (very hacky) comparison of various polygon clipping algorithms.

shut up and take me to the damn thing

method

The 'ground truth' to compare against was approximated via a rasterization of the polygons (using inkscape) followed by the boolean operations (using graphicsmagick)

Various implementations try to do the boolean operations on the polygons, the resulting polygons are also translated to svg, rasterized with inkscape and those results are finally compared on a pixel basis, using various metrics and graphicsmagick.

dir description

dissection contains a small viewer for the results

unisamples contain the fixtures as well as conversion tools

magick contains the 'ground truth' build using graphicsmagick

algorithms

martinez_{cgal,cpp} were build from http://www4.ujaen.es/~fmartin/bop12.zip

milevski uses https://github.com/w8r/martinez

rust-geo-booleanop uses https://github.com/21re/rust-geo-booleanop

voidqk uses https://www.npmjs.com/package/polybooljs

dependencies

this is far from packed for re-use, but if you insist, the main dependencies should be node, graphicsmagick and inkscape

graphicsmagick can be downloaded (source) and compiled into a set of command line utilities. See http://www.graphicsmagick.org/README.html

inkscape can be downloaded and installed. See https://inkscape.org

running

install LTS versions of npm and node.js

now run these commands inside the poly-bool-comparison directory

npm install
npm run setup

to re-run everything try running ./run... good luck ;)

to update a single algorithm run ./run <dirname>

About


Languages

Language:JavaScript 62.1%Language:Shell 23.4%Language:Rust 7.3%Language:HTML 4.2%Language:CSS 1.6%Language:Nix 1.4%