algorithm based on:
> Fractal Dimension of Dielectric Breakdown
> L. Niemeyer, L. Pietronero, and H. J. Wiesmann
> Phys. Rev. Lett. 52, 1033 – Published 19 March 1984
> It is shown that the simplest nontrivial stochastic model for dielectric breakdown naturally leads to fractal structures for the discharge pattern. Planar discharges are studied in detail and the results are compared with properly designed experiments.
first image upthread has the power parameter at 100, pretty sure the rectilinear stuff is an artefact of the pixel grid. with power 10 the lines are much more wiggly (image coming soon)
something went bad in this one (power 10), don't know why the thicker vertical/horizontal lines are there... they're not there in the previous image with 1/2 the iterations, but the texture is not so full....
tweaked some parameters and it went all weird - this one adds (alpha * (number of boundary pixels) ^ beta) new points each step, with alpha = 0.5 and beta = 0.25.
alpha = 0.125
alpha = 0.75
playing with line thickness
varying the power across the image gives a nice effect
takes a couple of minutes for an image at this resolution, but going bigger is slow - I guess it's O(dpi^4) which means doubling pixel dimensions will take 16x as long...
guess is because it's definitely O(dpi^2) per added pixel (need to solve Laplace equation for electric field), and number of added pixels is probably O(dpi^2) itself (to get to a fixed image density, the tree is 33% filled). pixels (actually, rasterized circles getting progressively smaller) are added one by one, with field solving in between each.
added a horizontal shift when plotting each circle (think this one was 1x radius)
I'm not using any special libraries beyond libc and libm. But I do use OpenMP pragmas for parallelism to speed it up.
I'm outputting PGM files (raw uncompressed 8bit greyscale raster bitmap data with a simple ASCII header). Actually my data is 1bit black and white, but packing it into PBM files is something I've not got around to yet.
unsigned char pgm[H][W];
// ... calculate image ...
fprintf(stdout, "P5\n%d %d\n255\n", W, H);
fwrite(&pgm, W * H, 1, stdout);
Then for some of the images, I use potrace to vectorize then upscale the vector version (mainly for printing, because 60dpi looks bad on paper...).
@mathr Oh, this is smart and cool. And also lightweight. I'll try to experiment a bit with PGM, it seems reasonably easy to manage. Thank you for the source snippet :)
Welcome to post.lurk.org, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.