Tree

Tree

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
lsystem Tree
 
{
set symbols axiom = F(0);
set initialAngle = 90;
set iterations = 4;
//set continuousColoring = true;
//set interpretEveryIteration = true;
 
interpret F(x) as DrawForward (30 ,4 + abs(x) * 2, darken(#00FF00, random(0.1*x, 0.3 + 0.02*x)));
interpret L(x) as DrawForward (20, 1 + abs(x) * 5 + x, darken(#CDAA7D, random(0.1*x, 0.3 + 0.02*x)));
interpret + as TurnLeft (10 + random(-4,4));
interpret - as TurnLeft (-10 - random(-4,4));
interpret X as TurnLeft (random(0,10));
interpret R as TurnLeft (random(-10,0));
interpret [ as StartBranch;
interpret ] as EndBranch;
 
rewrite F(x) to L(x+1) L(x+1) - - [ - F(0) + F(0) + F(0) + F(0) + F(0) ] + + + [ + F(0) - F(0) - F(0) - F(0) ];
rewrite L(x) to L(x+1) L(x+1);
//rewrite L(x) to L(x+1) X L(x+1) R;
//rewrite F(x) to F(x / 2) F(x / 2);
}
 
process all with BitmapRenderer;
//process all with SymbolPrinter;

Thumbnail extension

1
2
process all with BitmapRenderer
set iterations = 3;