Home > Flex, l-systems > L-systems in Flex

L-systems in Flex

I’ve made a small application in Flex to draw l-systems with.
The previous post explains what l-systems are exactly, but here are the rules again in short:

L-systems is a grammar describing the growth of plant-like structures. It is made up of simple drawing commands and rules how these change during growth. For example, you start out with the command ‘F’ meaning draw one unit. You add a rule that says ‘change F to F+F-F’ where ‘+’ and ‘-’ mean turn left and right, respectively, with a predefined angle. Then, as it grows, the sequence of commands grows longer and more complex, as every time each ‘F’ is replaced by ‘F+F-F’ until you end up with a long sequence of simple commands that make up a complex shape. Add branching with the ‘[' (start branch) and ']‘ (end branch) characters and you can quickly create nice plant structures.

Try out the application here. It’s a small first version with some limitations, such as a maximum amount of drawing commands to prevent slow processing times, the possibility to define only one rule, and the fact that it always starts out with ‘F’. You can define your own rule of how ‘F’ changes (using F, +, -, [ and ]), you can set the angle of rotation and the amount of iterations to define the complexity of the resulting shape. If responses are too slow, you can turn off ‘update realtime’ and hit the ‘go’ button to calculate your l-system.

lsys_flex_01.gif lsys_flex_02.gif lsys_flex_03.gif

Categories: Flex, l-systems Tags:
  1. July 11th, 2007 at 14:58 | #1

    Ralph is koning :-)

  2. October 18th, 2008 at 15:14 | #2

    source please !

  3. admin
    October 19th, 2008 at 04:14 | #3

    You can get to the source through the application. Just right click or control click and select ‘view source’ from the context menu.

  1. No trackbacks yet.