L-Sys 2 PBM

By copying a two files to your computer you will be able to translate Lindenmayer grammars into pictures. The first is a reduced version of Pfeiffer. The second is a jar file containing Mozilla's Rhino, which interprets JavaScript on your computer using your java environment.

Setting up one shot Pfeiffer

You will need java, the Rhino interpreter (copy 1.6r2 jar file) and the cut down version of pfeiffer.js

Command Line

The command line depends a bit on which operating system you are running. Essentially you use your java to run js.jar and give two arguments; the first is pfeiffer.js and the second is the grammar to be processed.
java -jar js.jar pfeiffer.js input > graphics output

input can be either the grammar itself or the name of a file containing it and graphics output is the name of a file to hold the output.

Solaris Example

java -jar js.jar pfeiffer.js 'str={F.++F.++F.} & sc=20 & it=3 #00ff00' > koch3_green_3yellow.pbm
Koch sneflug 3 expansions plus yellow trianglekoch3_green_3yellow.pbm

Microsoft DOS Example

java -jar js.jar pfeiffer.js "sc=20&it=3" > koch3.pbm
Koch sneflug 3 expansions without yellow trianglekoch3.pbm

Pictures

pfeiffer.js generates portable bit map pictures. These can be used directly, eg xv. Or you can convert them to other formats. For example, the two pictures above where converted by ImageMagick to GIF format. Eg:
convert koch3_green_3yellow.pbm koch3_green_3yellow.gif
W.B.Langdon (created 17 April 2006)