Teaching Aid

 
Right context
 

Right context

 
sm09_e15.png

 
Copy/Paste the following code to your GroIMP project:
//**********************************************************
/*
Variant of the preceding example
– Here, a right context is used.
– The modules A and S are not drawn, but replaced by visible
objects in the next step.
*/

module B extends Sphere(0.1)
{{setShader(GREEN);}};

// The modules A and S are not drawn.
module A;
module S;

protected void init()
[ Axiom ==> F(10, 0.1, 14) [ RU(30) S B ] A B; ]

// Here, the modules A and S will be replaced by F S and
// F A, respectively. The “bud” B remains unchanged.
public void runApical()
[
// context condition: all S followed by a B
S (* B *) ==> F(5, 0.1, 4) S;

// context condition: all A followed by a B
A (* B *) ==> F(10, 0.1, 14) [ RU(30) S B ] A;
]

//**********************************************************
 

DATE: 2009

 

AUTHOR: W. Kurth

 

DESCRIPTION:  see model
 

Welcome to the website grogra.de. This site is the web centre of growth grammars of the Department Ecoinformatics, Biometrics and Forest Growth at the Georg-August University of Göttingen and its cooperation partners.

--- not found