mathr / blog / #



Mandulia video (47MB, Ogg Theora)

As I briefly explained there's a connection between the Mandelbrot set and Julia sets, of which this project here takes advantage. An earlier prototype (100MB, Ogg Theora) had an alternating square/diamond lattice, which was visually a bit unpleasant. So thanks to some people on #haskell IRC, I got pointed to substitution tilings, and in particular the Ammann A3 tiling caught my eye while browsing the thingy. What struck me was the semi-regular spacing of the light blue/grey tiles, and the fact that there is a fixed point within each of those in the substitution rules: this fit my goal of an aperiodic point cloud with new points appearing in the gaps (1MB, Animated GIF) when zooming in (maintaining stability of the existing points).

The main program is written in Haskell, with the Julia Set renderer implemented in C (I found that GPU processing is actually less efficient than using the CPU for this problem, maybe I'm just doing it wrong but it seems like there are a lot of conditional loops and not enough data-parallelism). I learned some stuff about Control.Concurrent things in Haskell, like using nested MVar's to build a job scheduler and resource reallocator and whether to use safe or unsafe foreign imports with the threaded Haskell runtime (I think safe means it's slower for short calls but for long calls like rendering a fractal it works out faster as the runtime isn't blocked).

Source code is GPLv3+ licensed, Git repository at maximus/mandulia on Gitorious mandulia on