Upload files to ''
This commit is contained in:
parent
656fd70231
commit
47f9073c2c
37
drzewo.lpy
37
drzewo.lpy
@ -1,8 +1,8 @@
|
|||||||
import random
|
import random
|
||||||
a = 50
|
a = 50
|
||||||
length = 0.75
|
length = 2
|
||||||
dl = 0.01
|
dl = 0.05
|
||||||
globalwidth = 0.5
|
globalwidth = 1.5
|
||||||
degree = 70
|
degree = 70
|
||||||
def Start():
|
def Start():
|
||||||
#random.seed(150)
|
#random.seed(150)
|
||||||
@ -12,20 +12,26 @@ Axiom: SetGuide(treepath,90)_(1)@GsG(0.5)A(1,0.30)
|
|||||||
derivation length: 100
|
derivation length: 100
|
||||||
production:
|
production:
|
||||||
A(x,k) :
|
A(x,k) :
|
||||||
if x%7 == 0:
|
if k < 3.5:
|
||||||
produce /(96)F(6,1-k/5)A(x+1,k+0.1)
|
if x <= 7:
|
||||||
elif x <= 35:
|
produce /(96)F(0.7,1-k/5)A(x+1,k+0.01)
|
||||||
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)
|
elif x <= 14:
|
||||||
|
produce /(degree)F(0.7,1-k/5)[SetGuide(treepath2,8)_(0.2)&(90)-(60)B(1,k)]A(x+1,k+0.1)
|
||||||
|
else:
|
||||||
|
x = 0
|
||||||
|
produce A(x+1,k+0.01)
|
||||||
|
elif k < 4:
|
||||||
|
produce /(degree)F(0.7,1-k/5)[SetGuide(finish,8)_(0.2)&(90)-(60)B(1,k)]A(x+1,k+0.1)
|
||||||
B(x,k):
|
B(x,k):
|
||||||
r = random.random()
|
r = random.random()
|
||||||
if x <= 20:
|
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)
|
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):
|
C(x,k):
|
||||||
r = random.random()
|
r = random.random()
|
||||||
if x <= 10:
|
if x <= 3:
|
||||||
produce F(0.6)C(x+1,k+1)
|
produce F(0.6)C(x+1,k+1);(2)&(r*200)Leaf()
|
||||||
|
|
||||||
Leaf(x):
|
Leaf():
|
||||||
produce Sweep(path,section,length,dl,globalwidth,leafwidth)
|
produce Sweep(path,section,length,dl,globalwidth,leafwidth)
|
||||||
interpretation:
|
interpretation:
|
||||||
endlsystem
|
endlsystem
|
||||||
@ -59,17 +65,22 @@ def __initialiseContext__(context):
|
|||||||
ctrlPointList = pgl.Point3Array([(-0.5, 0, 1),(-0.238627, 0.00619407, 1),(-0.07298, -0.00805499, 1),(0.0491646, 0.0141531, 1),(0.234358, -9.59484e-005, 1),(0.398942, -0.00805499, 1),(0.565017, -0.00943561, 1)]) ,
|
ctrlPointList = pgl.Point3Array([(-0.5, 0, 1),(-0.238627, 0.00619407, 1),(-0.07298, -0.00805499, 1),(0.0491646, 0.0141531, 1),(0.234358, -9.59484e-005, 1),(0.398942, -0.00805499, 1),(0.565017, -0.00943561, 1)]) ,
|
||||||
)
|
)
|
||||||
treepath.name = "treepath"
|
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)]) ,
|
||||||
|
)
|
||||||
|
finish.name = "finish"
|
||||||
treepath2 = pgl.NurbsCurve2D(
|
treepath2 = pgl.NurbsCurve2D(
|
||||||
ctrlPointList = pgl.Point3Array([(-0.00917746, 0.0133432, 1),(0.226675, 1.80558, 1),(2.22693, 3.5567, 1),(3.06655, 5.98981, 1)]) ,
|
ctrlPointList = pgl.Point3Array([(-0.00917746, 0.0133432, 1),(0.72348, 1.57179, 1),(3.10364, 2.97222, 1),(3.50129, 4.69656, 1),(3.82637, 6.13593, 1)]) ,
|
||||||
)
|
)
|
||||||
treepath2.name = "treepath2"
|
treepath2.name = "treepath2"
|
||||||
panel_0 = ({'active': True, 'visible': True, 'name': 'Panel 1'},[('Curve2D',path),('Curve2D',section),('Function',leafwidth),('Curve2D',treepath),('Curve2D',treepath2)])
|
panel_0 = ({'active': True, 'visible': True, 'name': 'Panel 1'},[('Curve2D',path),('Curve2D',section),('Function',leafwidth),('Curve2D',treepath),('Curve2D',finish),('Curve2D',treepath2)])
|
||||||
parameterset = [panel_0,]
|
parameterset = [panel_0,]
|
||||||
context["__functions__"] = [('leafwidth',leafwidth),]
|
context["__functions__"] = [('leafwidth',leafwidth),]
|
||||||
context["__curves__"] = [('path',path),('section',section),('treepath',treepath),('treepath2',treepath2),]
|
context["__curves__"] = [('path',path),('section',section),('treepath',treepath),('finish',finish),('treepath2',treepath2),]
|
||||||
context["__parameterset__"] = parameterset
|
context["__parameterset__"] = parameterset
|
||||||
context["path"] = path
|
context["path"] = path
|
||||||
context["section"] = section
|
context["section"] = section
|
||||||
context["leafwidth"] = pgl.QuantisedFunction(leafwidth)
|
context["leafwidth"] = pgl.QuantisedFunction(leafwidth)
|
||||||
context["treepath"] = treepath
|
context["treepath"] = treepath
|
||||||
|
context["finish"] = finish
|
||||||
context["treepath2"] = treepath2
|
context["treepath2"] = treepath2
|
||||||
|
27
drzewo.lpy~
27
drzewo.lpy~
@ -1,8 +1,8 @@
|
|||||||
import random
|
import random
|
||||||
a = 50
|
a = 50
|
||||||
length = 0.75
|
length = 2
|
||||||
dl = 0.01
|
dl = 0.05
|
||||||
globalwidth = 0.5
|
globalwidth = 1.5
|
||||||
degree = 70
|
degree = 70
|
||||||
def Start():
|
def Start():
|
||||||
#random.seed(150)
|
#random.seed(150)
|
||||||
@ -12,20 +12,25 @@ Axiom: SetGuide(treepath,90)_(1)@GsG(0.5)A(1,0.30)
|
|||||||
derivation length: 100
|
derivation length: 100
|
||||||
production:
|
production:
|
||||||
A(x,k) :
|
A(x,k) :
|
||||||
if x%7 == 0:
|
if k < 4:
|
||||||
produce /(96)F(6,1-k/5)A(x+1,k+1)
|
if x <= 7:
|
||||||
elif x <= 35:
|
produce /(96)F(0.7,1-k/5)A(x+1,k+0.01)
|
||||||
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)
|
elif x <= 14:
|
||||||
|
produce /(degree)F(0.7,1-k/5)[SetGuide(treepath2,8)_(0.2)&(90)-(60)B(1,k)]A(x+1,k+0.1)
|
||||||
|
else:
|
||||||
|
x = 0
|
||||||
|
produce A(x+1,k+0.01)
|
||||||
|
|
||||||
B(x,k):
|
B(x,k):
|
||||||
r = random.random()
|
r = random.random()
|
||||||
if x <= 20:
|
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)
|
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):
|
C(x,k):
|
||||||
r = random.random()
|
r = random.random()
|
||||||
if x <= 10:
|
if x <= 3:
|
||||||
produce F(0.6)C(x+1,k+1)
|
produce F(0.6)C(x+1,k+1);(2)&(r*200)Leaf()
|
||||||
|
|
||||||
Leaf(x):
|
Leaf():
|
||||||
produce Sweep(path,section,length,dl,globalwidth,leafwidth)
|
produce Sweep(path,section,length,dl,globalwidth,leafwidth)
|
||||||
interpretation:
|
interpretation:
|
||||||
endlsystem
|
endlsystem
|
||||||
@ -60,7 +65,7 @@ def __initialiseContext__(context):
|
|||||||
)
|
)
|
||||||
treepath.name = "treepath"
|
treepath.name = "treepath"
|
||||||
treepath2 = pgl.NurbsCurve2D(
|
treepath2 = pgl.NurbsCurve2D(
|
||||||
ctrlPointList = pgl.Point3Array([(-0.00917746, 0.0133432, 1),(0.226675, 1.80558, 1),(2.22693, 3.5567, 1),(3.06655, 5.98981, 1)]) ,
|
ctrlPointList = pgl.Point3Array([(-0.00917746, 0.0133432, 1),(0.72348, 1.57179, 1),(3.10364, 2.97222, 1),(3.50129, 4.69656, 1),(3.82637, 6.13593, 1)]) ,
|
||||||
)
|
)
|
||||||
treepath2.name = "treepath2"
|
treepath2.name = "treepath2"
|
||||||
panel_0 = ({'active': True, 'visible': True, 'name': 'Panel 1'},[('Curve2D',path),('Curve2D',section),('Function',leafwidth),('Curve2D',treepath),('Curve2D',treepath2)])
|
panel_0 = ({'active': True, 'visible': True, 'name': 'Panel 1'},[('Curve2D',path),('Curve2D',section),('Function',leafwidth),('Curve2D',treepath),('Curve2D',treepath2)])
|
||||||
|
Loading…
Reference in New Issue
Block a user