Random vector-art generator based on splitting polygons/triangles into sub-triangles. Written in Haskell λ.
It works by repeatedly connecting a pair of outer nodes of a polygon with its center, such that a triangle is created. The process is then recursively applied to the set of constructed polygons.
This started as a toy project and serves now as a training ground to improve my Haskell skills.
git clone https://github.com/ahbnr/PolygonArt.git
cd PolygonArt
stack build
stack exec polygon 12 > output.svg && xdg-open output.svg
Doesn't work? You need stack!
You can also comfortably use the generator from a Web interface: https://github.com/ahbnr/PolygonArtWeb
You'll need the Haskell development tool stack.
Follow the official installation guide of stack. If you're using Arch Linux, the following command should do:
pacman -S stack
stack build
stack test
You can run it with an arbitrary integer as seed for the random number generator:
stack exec polygon <seed>
It will output the image in SVG format. Here's a complete example for generating and displaying an image on a graphical Linux installation:
stack exec polygon 1337 > output.svg && xdg-open output.svg
stack haddock