from openalea.plantgl.all import *

Axiom: P(Vector2(0,0)) E P(Vector2(0,1)) E P(Vector2(1,1)) E P(Vector2(1,0)) E P(Vector2(2,0))

derivation length: 3
production:

P(vl) < E > P(vr) --> E P(vl*4/8. + vr*4/8.) E 
P(vl) E < P(v) > E  P(vr) --> P(vl*1/8. + v*6/8+ vr*1/8.)

interpretation:

P(vl) < E > P(vr) --> ,(5) _(0.02) OLineTo(0,vr[0],vr[1])
P(v) : 
  if POINTS : produce ,(3)@O(0.04)

endlsystem
###### INITIALISATION ######

__lpy_code_version__ = 1.1

def __initialiseContext__(context):
	import openalea.plantgl.all as pgl
	Color_5 = pgl.Material("Color_5" , ambient = (0,0,0) , diffuse = 40 , )
	Color_5.name = "Color_5"
	context.turtle.setMaterial(5,Color_5)
	scalars = [('POINTS', 'Bool', True), ('DERIVATION', 'Integer', 3, 1, 20)]
	context["__scalars__"] = scalars
	for s in scalars:
		if not s[1] == "Category" : context[s[0]] = s[2]
__references__ = 'Przemyslaw Prusinkiewicz, Mitra Shirmohammadi, and Faramarz Samavati. L-systems in Geometric Modeling. Proceedings of the Twelfth Annual Worskshop on Descriptional Complexity of Formal Systems, pp. 3-12, 2010. '
