Compare commits

...

1 Commits

Author SHA1 Message Date
0f5ead6505 Upload files to '' 2019-05-28 17:39:23 +00:00
2 changed files with 22 additions and 8 deletions

View File

@ -1,9 +1,13 @@
import random
a = 50
length = 2
dl = 0.05
dl = 0.35
globalwidth = 1.5
degree = 70
phi = 90
alpha = 32
beta = 20
step = 0.1
stepleaf = 0.3
def Start():
#random.seed(150)
pass
@ -28,12 +32,22 @@ B(x,k):
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)
C(x,k):
r = random.random()
if x <= 3:
produce F(0.6)C(x+1,k+1);(2)Leaf()
if x <= 1:
produce F(0.6)C(x+1,k+1);(2)k(step-0.2)
Leaf():
produce Sweep(path,section,length,dl,globalwidth,leafwidth)
interpretation:
k(s):
if s >= 2.9:
produce Sweep(path,section,s,dl,globalwidth,leafwidth)
else:
produce k(s+stepleaf)
homomorphism:
k(s):
produce Sweep(path,section,s,dl,globalwidth,leafwidth)
endlsystem
###### INITIALISATION ######
@ -53,7 +67,7 @@ def __initialiseContext__(context):
)
path.name = "path"
section = pgl.NurbsCurve2D(
ctrlPointList = pgl.Point3Array([(-0.672727, 0, 1),(-0.324715, 0.227106, 1),(0.023332, -0.20146, 1),(0.337225, -0.0436618, 1),(0.695455, 0.00454545, 1)]) ,
ctrlPointList = pgl.Point3Array([(-0.672727, 0, 1),(-0.421083, 0.285059, 1),(0.023332, -0.20146, 1),(0.337225, -0.0436618, 1),(0.695455, 0.00454545, 1)]) ,
)
section.name = "section"
import openalea.plantgl.all as pgl

View File

@ -29,7 +29,7 @@ B(x,k):
C(x,k):
r = random.random()
if x <= 3:
produce F(0.6)C(x+1,k+1);(2)&(r*200)Leaf()
produce F(0.6)C(x+1,k+1);(2)Leaf()
Leaf():
produce Sweep(path,section,length,dl,globalwidth,leafwidth)
@ -66,7 +66,7 @@ def __initialiseContext__(context):
)
treepath.name = "treepath"
finish = pgl.BezierCurve2D(
pgl.Point3Array([(-0.465217, 0.00434783, 1),(-0.310145, 0.0826087, 1),(-0.324638, 0.456522, 1),(-0.408696, 0.669565, 1)]) ,
pgl.Point3Array([(-0.465217, 0.00434783, 1),(-0.310145, 0.0826087, 1),(-0.324638, 0.456522, 1),(-0.34633, 0.672535, 1)]) ,
)
finish.name = "finish"
treepath2 = pgl.NurbsCurve2D(