minimum distance sampling

https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf

That paper provided a wonderful way to do minimum distance sampling.
This commit is contained in:
Jack Wines 2024-02-12 11:50:43 -08:00
parent 17b433b01c
commit 3ed81da25a
No known key found for this signature in database
GPG key ID: 25B20640600571E6
13 changed files with 81 additions and 90 deletions

View file

@ -1,14 +1,14 @@
# image-triangles
Makes a [voroni diagram](https://en.wikipedia.org/wiki/Voronoi_diagram) and fills each cell with the average color the image below in. Please note, there's currently a bug. Some cells will be blank.
Makes a [voroni diagram](https://en.wikipedia.org/wiki/Voronoi_diagram) and fills each cell with the average color the image below in.
### examples
![Sierra mountains original](examples/sierra.jpg)
![Sierra mountains post-filter](examples/sierra-result.svg)
![Hawaii original](examples/birds-eye-view.webp)
![Hawaii original](examples/birds-eye-view.png)
![Hawaii post-filter](examples/birds-eye-view.svg)
![Dog original](examples/luna-but-square.jpeg)
![Dog post-filter](examples/luna-but-square.svg)
![Dog original](examples/luna.jpeg)
![Dog post-filter](examples/luna.svg)
### to run:
@ -16,7 +16,7 @@ Makes a [voroni diagram](https://en.wikipedia.org/wiki/Voronoi_diagram) and fill
#### with nix
```
nix run --experimental-features 'nix-command flakes' -- --cornerCount 800 --input examples/birds-eye-view.webp --output output.svg
nix run --experimental-features 'nix-command flakes' -- --minDistance 0.05 --input examples/birds-eye-view.png --output output.svg
```
#### with cabal
@ -24,6 +24,6 @@ Install [cabal & ghc](https://www.haskell.org/ghcup/) if you don't have them.
```
cabal update
cabal run image-triangles -- --cornerCount 800 --input examples/birds-eye-view.webp --output output.svg
cabal run image-triangles -- --minDistance 0.05 --input examples/birds-eye-view.png --output output.svg
```