by ralf • Sunday January 25th, 2009
Posted in Desktop Gallery, Fractal Flames

Sometimes it feels good to get back to the basics. Here’s a fun example of self-similarity, obtained by stacking squares onto the sides of a right triangle, then new triangles onto the new squares, and new squares onto the new triangles…etc. ad infinitum. The result we might call a “Pythagorean Tree”.

Some more examples of Pythagorean trees are shown here (although some use isosceles triangles rather than right triangles).


Widescreen (16:9) » 1440×900 » 1680×1050 » 1920×1200 » 2560×1600
Fullscreen (4:3) » 1024×768 » 1600×1200
Others » 1280×1024 » iPhone

Rendered in Oxidizer 0.5.5.


  1. Don Larson
         January 25, 2009

    Very cool! Thanks for the external link too!


  2. Bo-Dion
         January 26, 2009

    Hallo ralf, it’s very beautiful. I’ve got to learn the basics too, from now on.
    Could you share this flam-file? It would help me a lot to have a look, how
    this one had been constructed.

  3. ralf
         January 26, 2009

    Certainly, here you are: pythagoras.flam3

    It’s very simple, just two linear transforms aligned to make a triangle – have a look in the Transform Editor. The third one just adds the filled square without any coordinate transformation, in order to visualize the geometry. Enjoy :-)

  4. Bo-Dion
         January 26, 2009

    Thanks a lot, I will check this when my render is finished ( so tomorrow ).
    If you find the time for it, it would be great to make a little flamepack
    for beginners, to toy around with and to have a look at the inside.
    I only had genome-1, out of your tutorial, wich was quite potential using with
    the scripts. There are no flamepacks for oxi’s right now, or?

  5. ralf
         January 26, 2009

    Not exactly tutorial material, but I have a small collection of classical fractals that you can have a look at. This contains things like the Sierpinski gasket and Barnsley’s fern. Although very simple systems, they are instructive to examine in order to gain an understanding of the principles of image encoding by iterated function systems.

    If you are using scripts, I wrote a small script for generating the Pythagoras trees for an arbitrary angle: pythagoras.lua

  6. ralf
         January 26, 2009

    By the way, if someone wants to *write* a fractal tutorial for Oxi beginners, I’d be happy to collaborate on it :-)

    I sometimes wish there was more interaction between users, in sharing tips and tricks and genomes. Much of what I’ve been doing is just reinventing the wheel, and while that can be fun, it’s also very slow learning :-(

  7. Bo-Dion
         January 26, 2009

    Juhuu, thank you so much! This will keep me shut up for quite a while!
    And a hail from the queens of the stoneage.

  8. Bo-Dion
         January 27, 2009

    Dear ralf, you gave away the atombomb…

  9. paulk
         January 27, 2009

    Amazing images, ralf! And you said you weren’t good at designing genomes… ;-)

  10. ralf
         January 28, 2009

    Well I can’t take credit for the Pythagorean trees idea, this has been done by others. I saw a black and white wire-frame version of some in the book “Chaos and Fractals” (Peitgen et al.), and figured that would be cool to try in Oxi :-)

  11. paulk
         January 28, 2009

    Well, nice job of coding it in Oxi and coloring it, then! :-)

    And thanks for the link to the classics as well.


  12. Bo-Dion
         January 29, 2009

    Hi Paulk, i found and lost the link to your personal Oxi-gallery somewhere here
    on Rampant. I was very fond of it, can you give the link again. THX. Are you to
    find on DA too?

  13. paulk
         January 30, 2009

    Hi, Bo-Dion;

    That Oxi-gallery is at And, yes, I’m also on DA here, and then I have this
    other little site here. </plug >


  14. pharmagician
         February 2, 2009

    Ralf – I tried to use the Pythagoras.lua script but kept getting all kinds of error messages. How much do I have to re-edit it? I wish I understood more about scripting :-( – I can tweak all the parameters etc but have no idea what has to be rewritten here!

  15. ralf
         February 2, 2009

    Ay caramba. Sorry about that – in principle you should just need to edit the first line, to set “luadir” to the full file path to the utils.lua script,since it uses some functions from that package. The utils package is here: utils.lua. Let me know of there are other errors.

  16. pharmagician
         February 2, 2009

    Don”t worry! This is the current error message:

    cannot open ~Applications/Fractal_applications/Oxidizer_0.4.3/example_scripts/utils.lua: No such file or directory

    I have it in that directory, but some dir names have spaces – but it doesn’t work with spaces or underscores in the path descr…..

    Thx for any tips!

  17. ralf
         February 2, 2009

    Hmm well maybe that should be /Applications/ or ~/Applications/ ? (missing a leading /) If that doesn’t work, also try to insert a backslash (\) before the spaces.

  18. ralf
         February 2, 2009

    Wait, that’s wrong – it’s the tilde, for some reason it doesn’t recognize this, so you have to type out the full path, e.g. /Users/pharmagician/Applications/ whatever. But spaces in the folder names should work, I just tested this, just be sure to put the whole thing in quotes ”.

  19. ralf
         February 2, 2009

    Also, if you want the thing to be filled-in with squares, set squares=1 (the default was apparently 0).

  20. ralf
         February 3, 2009

    And also try different angles (alpha) and triangle types (ftype) (‘pyth’, ‘iso1’ or ‘iso2′). Try for instance alpha=36 degrees with ftype=’pyth’. :-)

  21. ralf
         February 3, 2009

    P.S. It’s also easy to modify the script to make animations:,

    Ok I’ll shut up now!

  22. pharmagician
         February 3, 2009

    thanks for all this – will try when I get home this evening!

  23. Bo-Dion
         February 3, 2009

    This might be nonsense, but hear: I had no problem running the script.
    I knew from the tutorial to change the luadir – so i put it into my tutorial
    folder and changed the luadir to full path to my tutorial folder – and it
    worked !?

  24. Bo-Dion
         February 3, 2009

    The euclid moves are crazy – can i get the script to it ?
    Because i can’t modify anything ( of course ).

  25. ralf
         February 3, 2009

    Sure, this one is called euclid.lua. It’s a hardwired code, though, not compatible with the general animation sequencer (seq7.lua) that I’ve coded.

    By the way, have you guys seen Dave’s latest addition to Oxi in CVS? Uj uj uj, *very* useful stuff for running scripts :-)

  26. Bo-Dion
         February 4, 2009

    Thank you, i just discovered your animation scripts, because i was just to busy.
    This is unbelievable fun to me! I’m just dealing with seq3 in the moment, because
    i’m unable to understand what to do with the different scripts that are needed
    to run seq7. But may i’ll get it too, soon.
    Look, we are nearly up to 30. now…

  27. ralf
         February 4, 2009

    seq7 requires the utils.lua and mods.lua scripts, plus an input control script. The path to these have to be declared in the beginning of the seq7 script, but otherwise you should not have to modify seq7. I have written some instructions on the animation page, and there’s even more in the doq7.lua example control script. Let me know if you have questions :-)

  28. pharmagician
         February 4, 2009

    yep – just got rid of “~” and my luadir path worked! Lurvely script, Ralf! :-)

Sorry, comments for this entry are closed at this time.