Bonus Friday Post “First Fractals of the Year!”

For today’s post I thought I’d take you through some of my “creative process” for playing with L-Systems, fractals created using an algorithmic grammar.

We start with a simple shape:

StartingThought

This shape is my “replacement rule” for the L-System. To draw this shape I use the sequence of letters F-F+F+F-F, with F meaning “draw a line forward”, ‘-‘ meaning “turn left 120 degrees” and ‘+’ meaning “turn right 120 degrees.” If I start with a triangle, and replace each side of the triangle with this starting shape I get the following:

FirstStage

If I repeat this for each line of the new shape, and again on each line of the resulting shape, after a few iterations I get this:

SierGasketInnardsLSys_LQ

The Sierpinski Gasket, one of the most persistent recurring fractals with untold methods for drawing it.

But what if I didn’t start with a triangle? What if I started with a square?

Then I’d get this:

SierGasketChineseStarLSys_LQ

That’s pretty good, but if what if inverted the square by flipping it inside out. A typical square is drawn F+F+F+F with ‘+’ being a right turn of 90 degrees. But if I change those pluses to minuses I get this:

SierGasketChineseStarInvertLSys_LQ

And here’s what an inverted pentagon would look like:

SierGasketPentagonInvertLSys_LQ

Okay, that’s pretty good, but what if we skewed our initial replacement shape?

FirstSkew

So now our initial triangle would look something like this:

FirstSkewStage

Keep repeating this process and you get something really different:

SierGasketInnardsSkewedLSys_LQ

Same number of lines that we used to draw our Sierpinski Gasket, but with less overlap (this is one of my favorites). Let’s try another skewed shape:

SecondSkew

And the resulting first stage is:

FirstSkew2Stage

Now what do we get?

SierGasketInnardsSkewed2LSys_LQ

That’s good but let’s invert it. Our first stage is:

Skew2Inverted_Skew3

And after a few iterations we get:

SierGasketInnardsSkewed3LSys_LQ

Now let’s start with an inverted hexagon:

Skew2InvertedHex_Skew4

And see what happens:

SierGasketInnardsSkewed4LSys_LQ

If we turn the hexagon right-side out:

Skew2Hex_Skew5

We get this:

SierGasketInnardsSkewed5LSys_LQ

But L-Systems also allow for moving without drawing a line, typically represented by the ‘f’ character. Let’s take our first motif and remove a section:

FirstSkip

If we apply this replacement rule to an inverted triangle we get this:

FirstSkipInvertedFirstStage

And after a few iterations:

SierGasketInnardsSkipLSys_LQ

Turn our triangle right-side out and we get:

FirstSkip_Skip2

Followed by:

SierGasketInnardsSkip2LSys_LQ

Here’s a couple other skip motifs:

SierGasketInnardsSkip3LSys

And the result:

SierGasketInnardsSkip3LSys_LQ

Initial Stage:

SierGasketInnardsSkip4LSys

Result:

SierGasketInnardsSkip4LSys_LQ

Now let’s remove some sections from our skewed replacement rules:

SierGasketInnardsSkewedSkipLSys

First Stage:

SierGasketInnardsSkewedSkipLSysFirstStage

Result:

SierGasketInnardsSkewedSkipLSys_LQ

Replacement Motif:

SierGasketInnardsSkewed2SkipLSys

First Stage:

SierGasketInnardsSkewed2SkipLSysFirstStage

Result:

SierGasketInnardsSkewed2SkipLSys_LQ

Each of the above shapes had no replacement rule for ‘f’ so these segments were kept empty. If we use the same replacement rule for ‘f’ as we do for ‘F’, we get these respectively:

SierGasketInnardsSkewedSkip2LSys_LQ

And this:

SierGasketInnardsSkewed2Skip2LSys_LQ

Similar to our originals, but with less internal lines.

Finally, let’s look at a couple more variations. A wider initial stage can stretch our gasket:

Motif:

SierGasketInnardsWiderLSys

First Stage:

SierGasketInnardsWiderLSysFirstStage

Result:

SierGasketInnardsWiderLSys_LQ

And a hex-bump creates a non-overlapping curve.

Motif:

HexagonBumpLSys

First Stage:

HexagonBumpLSysFirstStage

Result:

HexagonBumpLSys_LQ

All of these shapes were created from variations on a five-line motif. Hopefully you can see from this post how tiny variations in method can create huge changes in result.

Have a happy fractal friday!

*All images were created using L-System 6 from Chapter 4 of Fractals: A Programmer’s Approach available on Amazon. Download a docx file containing all of the XML data for these images here. Hi-res versions of the above images are available by clicking on each image.

Like cool fractal designs, maybe some you can color? Then check out my latest Adult Coloring Book: Fractals available on Amazon.

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s