Main Projects Background
PentiumGCC EGCS Judge
FreeISDN Gimp Destripe
==lsys== FCrackZip root-tail
lma-init PApp Suxus
LibLZF ISO tables Xcb
speedstep Deliantra MORPG

Last change: 2008-11-06

[two plants generated by l-systems] [another plant generated by an l-system]



What *is* it?

A program to interpret and draw Lindenmeyer systems (l-systems for short).

Erh, again?

Well, to the left are two examples of l-systems (click for enlarged versions). The l-system that generated the higher of the two images looks like this:
// some fantasy flower

include (simple_leaf)
include (simple_petal)

fig(n)		=> tree(5), n;

tree(n)	: n	=> attr (color, '0.2 0.8 0) attr (width, 2) F(8) L /(137.5) tree(n-1);
tree(n)		=> F(10) attr (color, '1 1 0) attr (distance, 5) /(9) petal (10, 8);
L		=> [attr (width, 1) &(30) simple_leaf (30, 30) ^(15) F(15) attr (distance, 4) petal (80, 3)];

This is not too long, given the nice-looking result, no? Granted, it "only" defines the skeleton of the plant (the leaf and petal shapes are defined elsewhere), but it does specify growth, color and shape.


The rationale for writing it

Well, I found l-systems quite fascinating. However, the available software was either very bad, compiled only on esoteric or outdated systems or, well, was not really available.


Current state

At the moment I am unable to put much work into it (the only reason I released it now was because the source is rotting away on my harddisk for many months).

The current version is highly alpha - there is NO documentation whatsoever included in the distribution. Your only source of documentation at the moment is this page. I'm afraid that there are many, many portability problems in this version. If you can, please check it out and send me some bug-reports.


How do I compile/install/use it?

Lsys comes with a configure script. Just run ./configure and everything should get configured (enter ./configure --help) to get a list of options).

Next build it by entering make. Do not enter make install, as that doesn't do much useful at the moment.

You should be able to get some output by entering lsys -Ilib lib/capsella_bursa_pastoris.l 15. If you do not have opengl/mesagl support compiled in (that really is a must) you can force boring postscript output by specifying lsys -Ilib lib/capsella_bursa_pastoris.l 15 15 -o -f ps.

If you encounter any problems ;) Or have any questions ;) Then don't hesitate to send me an email!


Where to get it?

To download the distribution, you currently have to use CVS, see its package page on the Schmorpforge Ta-Sa Software Repository.



Here are some random links from my bookmarks file that might be of help:

FRACTINT L-systems tutorial
L-Systems Links (including tutorials)
L-systems Software
Visual Models of Morphogenesis: A Guided Tour


More Examples

[colourful Koch Pyramid] Here's another example, the so-called Koch Pyramid:
# this ruleset is not really necessary, but it improves efficiency
ruleset ( T => F+F+F+F; )

define angle deg(acos(1/3));

tet_koch(n) => attr (delta, 120)

T => [attr(distance,distance*0.5)
      attr(color,'1 0 0) F[+(60)\(angle)T]F+
      attr(color,'0 1 0) F[+(60)\(angle)T]F+
      attr(color,'0 0 1) F[+(60)\(angle)T]F


Any questions/hints/critics? Contact the author of this page!