2019-05-09 13:39:36 +02:00
|
|
|
import random
|
|
|
|
a = 50
|
2019-05-16 11:47:32 +02:00
|
|
|
length = 0.75
|
|
|
|
dl = 0.01
|
|
|
|
globalwidth = 0.5
|
|
|
|
degree = 70
|
2019-05-09 12:08:10 +02:00
|
|
|
def Start():
|
|
|
|
#random.seed(150)
|
|
|
|
pass
|
|
|
|
|
2019-05-16 11:47:32 +02:00
|
|
|
Axiom: SetGuide(treepath,90)_(1)@GsG(0.5)A(1,0.30)
|
|
|
|
derivation length: 100
|
2019-05-09 12:08:10 +02:00
|
|
|
production:
|
2019-05-09 13:39:36 +02:00
|
|
|
A(x,k) :
|
2019-05-16 11:47:32 +02:00
|
|
|
if x%7 == 0:
|
|
|
|
produce /(96)F(6,1-k/5)A(x+1,k+0.1)
|
|
|
|
elif x <= 35:
|
|
|
|
produce /(degree)F(0.7,1-k/5)[SetGuide(treepath2,8)_(0.3)&(90)-(60)B(1,1.0)]A(x+1,k+0.1)
|
2019-05-09 13:39:36 +02:00
|
|
|
B(x,k):
|
2019-05-16 11:47:32 +02:00
|
|
|
r = random.random()
|
|
|
|
if x <= 20:
|
|
|
|
produce F(0.8,0.05+0.25/k)[/(r*500)+(20)_(0.02)F(1)C(1,1.0)]B(x+1,k+1)
|
2019-05-09 13:39:36 +02:00
|
|
|
C(x,k):
|
2019-05-16 11:47:32 +02:00
|
|
|
r = random.random()
|
|
|
|
if x <= 10:
|
|
|
|
produce F(0.6)C(x+1,k+1)
|
|
|
|
|
2019-05-09 12:08:10 +02:00
|
|
|
Leaf(x):
|
2019-05-16 11:47:32 +02:00
|
|
|
produce Sweep(path,section,length,dl,globalwidth,leafwidth)
|
2019-05-09 12:08:10 +02:00
|
|
|
interpretation:
|
2019-05-16 11:47:32 +02:00
|
|
|
endlsystem
|