Ok, I solved it for now in a dirty way (it is only applicable for Pythagoras Trees which use the exact syntax as in the image below). Click for a larger version.

The B in the rules replaces the F in the old one. Why? Because B shouldn't scale like the other lines. In other words, B is a line at the previous level. The other variables (A and F) should scale with sqrt(2)/2 per level.
I added this line to
lindenmayer.inx:
Code: Select all
<param name="factor" type="float" precision="8" min="0.0" max="100.0" _gui-text="Factor">0.0</param>
To the file
lindenmayer.py I made some more changes. Most important ones, In the
__recurse() part:
Code: Select all
addition = self.__recurse(self.rules[c],level+1)
addition = addition.replace('A','A*')
addition = addition.replace('B','B*')
addition = addition.replace('F','F*')
level_string = level_string + addition
This adds an asterisk after each occurrence of A, B and F. So at level 0, there won't be any asterisks, the lines at level 1 will have one, etc. Next, the
__compose_path():
Code: Select all
i = 0
while i < len(string):
if string[i] in 'ABCDEF':
self.turtle.pd()
scaling = 0
while (i+1+scaling < len(string) and string[i+1+scaling]=='*'):
scaling+=1
if string[i] == 'B': #Scale with respect to the previous level, so decrease scaling.
scaling-=1
self.turtle.fd(self.options.step * (self.options.factor**(scaling)) * (random.normalvariate(1.0, 0.01 * self.options.randomizestep)))
This counts the amount of asterisks after the A, B and F characters. Since B should scale with respect to the previous level, there is an extra if-clause. The actual scaling happens by multiplying the step with the factor^level.
Since I'm not familiar with Python, there may be more elegant solutions

.