Using Fractint 'L' files with LParser or LMUSe
Fractint ( see spanky.fractint.org/www/fractint/fractint.html) is a popular free fractal program which includes the capability of rendering 2-d Lindenmayer systems quickly. A large number of 'L' files, each containing many L-system examples, can be found in spanky.triumf.ca/pub/fractals/LSYSTEMS/ . Because there are so many intriguing forms available in this format, the following notes are to help in using those Fractint rules in LMUSe (or LParser).
In order to use Fractint L-System rules in LMUSe, you have to 'translate' from the Fractint L language into LMUSe/LParser terms.
A first thing to realize is that Fractint symbols are not case sensitive. In Fractint, 'f' is the same as 'F'. ('f' is a different turtle command from 'F' in LParser or LMUSe).
One Fractint 'L' file can contain many sets of L-system rules. To use in LMUSe, each different L-system rule set has to have its own file. Fractint L-systems are also enclosed in curly brackets (to delineate where. one system ends and another begins). You have to erase those. Plus you have to get rid of the labels like 'Angle' and Axiom'. and insert a recursion level on the first line. Also, the comment character in LMUSE is '#' while in the Fractint .L files it is ';'. And the angle in the Fractint files is a division of 360 degrees rather than the number of degrees itself. One other major difference in symbols is that @nnn in Fractint systems is the command to multiply line segment lengths by nnn, while the corresponding LMUSE command is '(nnn). (a quotation mark followed by the multiplier).
The following table contains my suggestions for replacing the Fractint symbols:
Fractint | LMUSe | note |
F | F | |
f | F | |
Dx | F(x) | see * |
G | g | |
g | g | |
Mx | g(x) | see * |
+ | + | |
- | - | |
\x | -(x) | see * |
/x | +(x) | see * |
| | %| | one symbol to two symbols |
[ | [ | |
] | ] | |
Cx | c(x) | see * |
cx | c(x) | see * |
<x | (c0=c0+x) | To translate Fractint's '>' and '<' (increment/decrement color number) precisely you will have to use a 'declared constant', for example set 'c0=1', then increment with (c0=c0+x) . If actual color is not important, replace either '<x' or '>x' with just 'c'. But this will just increment the color number by 1, not increment the color by x (unless, of course, x is 1)or decrement the color. |
>x | (c0=c0-x) | |
! | % | |
@x | '(x) | see * |
Ix | (1/x) | * In Fractint x may be a plain number, or may be preceded by I for inverse, or Q for square root. (e.g. @IQ2 divides size by the square root of 2). In LMUSe, use (1/x) in place of Fractint Ix, or (sqrt(x)) in place of Qx. |
Qx | (sqrt(x)) | |
; | # | comment |
And, of course, take care that any other symbols in the Fractint file aren't LMUSe symbols. For example, Zs in the Fractint file are like 'dummy' variables and are used freely, but in LMUSe, Z draws a line. Zs would have to be replaced by some other symbol which has no meaning to LMUSe. (eg A)
Also, in Fractint a single rule can be split into two parts (presumably so that it can be read on a single screen without text wrapping). For example
x=Fx-Fx x=++Fx-Fx
('two rules for x') in Fractint actually means the single rule
x=Fx-Fx++Fx-Fx
Here is a sample Fractint lsystem:
Dragon { Angle 8 ;Specify the angle increment to 45 degrees Axiom FX ; Starting character string F= ; First rule: Delete 'F' y=+fX--fY+ x=-FX++FY- }
and its translation for LMUSe or LParser:
# Dragon 7 # A number of recursions (not set in the Fractint rule file) 45 # the angle is 360/8 = 45 degrees 10 # thickness (not used by Fractint, included here for compatiblility with LParser) FX # The Axiom F= # First rule: Delete 'F' y=+Fx--Fy+ x=-Fx++FY-
To get the LMUSe angle, divide 360 by the Fractint 'Angle'.
Notice that you will need to pay attention to upper and lower case in symbols. Fractint doesn't care, but LMUSe does.
Finally, this translation process does not, generally, go both ways. That is, Lparser systems can't ususally be turned into Fractint L-systems, at least not without much lost structure.