2020-10-18 Fractals

@neauoire’s dotgrid, and the C variant, seems to have inspired @l3kn to write a similar small C program called quad using the SDL library to create fractals. You can read more about the general idea on Leon’s blog post Quadtree Grammars. Anyway, I decided to download the program and give it a whirl!

The first problem was that my laptop monitor is too small. I therefore had to halve the constants for SIZE, MENU_SIZE and MENU_WIDTH. (Note that this is now much improved: you can provide the size on the command line as an argument!)

The next problem was the user interface with no explanation. (Note that this is now also much improved!) You basically have to stare at the definition in the menu on the left and reproduce it in order to get it: start with the first square; into the four quadrants you either drag some patterns from above, or you drag one of the tiny squares from elsewhere in the menu, and do that recursively – in order to generate the sub-quadrants... recursively. It is a fractal, after all. Essentially, you have eight “rules” to generate the four quadrants and you start with the first one.

Here’s a little progression of increasingly complex fractals:

Image 1 Image 2 Image 3

As I recently mentioned Postscript, also note the Quadtree Grammars using Postscript blog post. So cool!



Here’s a simple variant coded up as a web app: Sitelen Musi.

– Alex Schroeder 2020-10-29 23:42 UTC

Things I’d like to add: png export at higher resolutions; recomputing as you type; export url.

– Alex Schroeder 2020-10-30 10:16 UTC

Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. Note: in order to facilitate peer review and fight vandalism, we will store your IP number for a number of days. See Privacy Policy for more information. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Just say HELLO