H-tree

H-tree

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
lsystem Htree(R = sqrt(2)) extends Branches {
 
set symbols axiom = + A(1);
set iterations = 11;
set lineCap = none;
 
interpret F(x) as DrawForward(R ^ x * 2 ^ -(currentIteration / 2) * 256, x);
interpret + as TurnLeft(90);
interpret - as TurnLeft(-90);
 
rewrite A to F(1) [+A] [-A];
rewrite F(x) to F(x + 1);
}
 
process all with SvgRenderer;