An interesting famliy of L-systems

first croppedI was playing around with random L-systems when I ‘discovered’ this shape. Random L-systems tend to be very, well, random so this symmetric image was quite interesting. The ruleset to produce it was very simple, so I decided to vary the parameters and see what other images would come out. Turns out there were many more shapes in this family that are interesting.

L-systems are created by specifying an initial starting string, a set of substitution rules to be applied. So in this case, the starting axiom is ‘F’, the rule is that ‘F’ is replaced by ‘FFFFF+’ which is applied 4 times to generate the final pattern. To get the picture you use a LOGO like system where F means go forward and + means turn right 30 degrees.

Two obvious parameters to change were the number of ‘F’s in the substitution and the number of times to apply the rule. So lets look at different numbers of Fs:

7 Fs’: 7 fs 9 Fs: 9fs 16 Fs:16 Fs

So it seems like increasing the rule length generates more complex pictures, right? Well not really. Compare the images for 18 and 19:

18 Fs: 18 Fs 19 Fs: 19 Fs

So it seems the group of images is in some sense closed:

12 Fs: 12fs 24 Fs:24 Fs

Another interesting recurring shape is the dodecagon, clearly arising from the 30 degree turn used:

23 Fs: 23fs.

Does anyone recognise these shapes?  Surely they must have been described before?

4 Responses to “An interesting famliy of L-systems”

  1. Mandeep Says:
    Images for 18Fs and 19Fs are strikingly different. 19F is more closer to 7F. It appears as that some remainder / offset was increasing as we moved from 7F to 18F and got reset to zero again. 30 degrees turn hint it to a cycle of 12 (360/30). So 7F, 7 12F, 7 24F also should be fair siblings. James am very curious to see 7 24F, i.e 31F now.

    Thanks.
  2. James Says:
    Can you drop in some colour sub rules when rendering these, would be nice to see the colour changes throughout the image indicating the evolution of the shape.
  3. James Casbon Says:
    Yeah thinking of doing colour based on logarithmic frequency of visiting a point, fractal flame style.
  4. Bill Compton Says:
    Hi Jim. Photos i received. Thanks

Leave a Reply