Teaching Aid

Schoute architectural model

 

 
Copy/Paste the following code to your GroIMP project:
//**********************************************************
/*
You will learn with this example:
– how to create a simple plant model (according to the architectural model Schoute)
– how to specify branches (subgraphs) by using [ ]
*/

// Example of a simple tree architecture (Schoute architecture)
//———– Extensions to the standard alphabet ———-

// Shoot() is an extension of the turtle-command F() and stands for an annual shoot

module Shoot(float len) extends F(len);

// Bud is an extension of a sphere object and stands for a terminal bud
// its strength controls the length of the produced shoot in the next timestep

module Bud(float strength) extends Sphere(0.2)
{{ setShader(RED); setTransform(0, 0, 0.3); }};

//———————————————————–

protected void init()
[
// initial state (one bud)
Axiom ==> Bud(5);
]

public void run()
[
// a square bracket [] will indicate a branch (daughter relation)
// Rotation around upward axis (RU) and head axis (RH)
// Decrease of strength of the Bud (each step by 20%)

Bud(x) ==> Shoot(x) [ RU(30) Bud(0.8*x) ] [ RU(-30) Bud(0.8*x) ];
]

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

DATE: 2009

 

AUTHOR: W. Kurth

 

 

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.