Fractals in Blender? Is it possible to define a true mathematical fractal in Blender? 

For example, would it be possible to use a script or a Blender addon to procedurally generate 3D fractal objects. This could be immensely useful for a number of natural objects that happen to be fractal in nature, such as snowflakes, broccoli, tree branches, ferns, coastlines, mountains, etc?

Fractal snowflake:



Fractal Romanesco broccoli:



My first thought was to use the Add 3D Function Surface addon, but that doesn't currently allow for recursive definitions. Using textures, combined with images of fractals could help with 2D objects (such as the snowflake), but this solution doesn't really allow for the generation of these fractals. So my question is, is it possible currently to recursively generate fractals in Blender, either with built in functionality or with an addon? If this functionality isn't yet available, would it be possible to write a script to do this?
This script will generate a 2D Mandelbrot set in Blender using OSL.

#include &lt;stdosl.h&gt;

shader node_fractal(
        float CenterX = 0.0,
        float CenterY = 0.0,
        point Vector = P,
        float Zoom = 1.0,
        int MaxIterations = 50,
        color Foreground = color(1.0),
        color Background = color(0.0),
        output float Fac = 0.0,
        output color Color = 0.0)
{
    point p = Vector / (2* Zoom);
    float auxiliar = 0.0;

    p[0] += CenterX;
    p[1] += CenterY;

    point pa = p;
    point pb = point(0.0);
    int i = 0;
    for(i=1; i&lt;MaxIterations; i++)
    {
        pb[0] = pa[0]*pa[0] - pa[1]*pa[1];
        pb[1] = pa[0]*pa[1] + pa[1]*pa[0];
        pa = pb + p;
    }

    auxiliar = sqrt((pa[0]*pa[0]) + (pa[1]*pa[1]));

    Fac = clamp(auxiliar,0.0,1.0);

    if (Fac == 0.0)
        Color = Background;
    else
        Color = mix(Foreground, Background, Fac);
}


Result:



Source: http://elbrujodelatribu.blogspot.fr/2013/04/blender-cycles-osl-mandelbrot-fractal.html