**Improving leaf shape in the simple tomato model** For improved leaf shape, we can define the leaf contour using a mathematical model. Below is the implementation of a simplified version; for the full equation, see [[https://doi.org/10.14214/sf.7740|Coussement et al. (2018)]]. To add the leaf shape function into the model, open the ''simple_tomato_growth_sdau.gsz'' example and copy the code below inside the ''modules_organs.rgg'' file. module Leaflet(float length, double width) { } ==> [ { int segments = 100; } for (double i=1; i < segments; i++) ( { double segmentLength; segmentLength = length/segments; // getNormalizedLeafWidth specifies the half of the shape double segmentWidth = 0.5*width * getNormalizedLeafWidth(1 - i/segments); } Parallelogram(segmentLength, 2*segmentWidth).(setShader(GREEN)) RL(60.0/segments) ) ]; // calculate leaf shape as the normalized width along the midrib, // full model: Coussement et al. 2018 // https://doi.org/10.14214/sf.7740 static double getNormalizedLeafWidth(float lnorm) { double k1 = 2; double k2 = 2.2; double gL = 0; double maxWidth = 0.6; if (lnorm <= maxWidth) { gL = 1 - Math.pow((maxWidth - lnorm)/maxWidth,k1); } else { gL = 1 - Math.pow((lnorm - maxWidth)/(1 - maxWidth),k2); } return gL; } Then, inside the definition of ''module Leaf'', replace every occurrence of ''Parallelogram'' by ''Leaflet''. Updated model: * {{ :workshops:simple_tomato_growth_niceleaflet_sdau.gsz |}} **Modelling with L-systems.** Slides: * {{ :workshops:sdau_practical_3b_groimp_xl.pdf |}} Model example: * {{ :workshops:simple_development_template_sdau.gsz |}} * {{ :workshops:lsystems.gsz |}} **Simple models of development.** Slides: * {{ :workshops:sdau_practical_3_groimp_xl.pdf |}} Simple development model demonstrating the use of different type of rules. Model example: * {{ :workshops:simple_development_rggrules_sdau.gsz |}} **Simple tomato crop model.** Model example: * {{ :workshops:simple_tomato_growth_sdau.gsz |}} //Optional:// How to construct a simple tomato architecture model. Tutorial: [[tutorials:simple-tomato-model|A simple tomato plant model]] Model examples: * {{ :workshops:summer_school_25:02_monday:simple_tomato.gsz |}} * {{ :workshops:simple_tomato_textures.gsz |}} * {{ :workshops:summer_school_25:02_monday:simple_tomato_mesh.gsz |}}