tutorials:simple-tomato-model
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:simple-tomato-model [2024/12/07 15:30] – [Improving leaflet shape] ksmolen | tutorials:simple-tomato-model [2024/12/07 16:02] (current) – [A simple tomato plant model] ksmolen | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== A simple tomato plant model ====== | ====== A simple tomato plant model ====== | ||
- | In this tutorial we will create a simple model of architecture and development | + | In this tutorial we will create a simple model of a tomato plant architecture. |
===== Preliminary steps ===== | ===== Preliminary steps ===== | ||
Line 199: | Line 199: | ||
</ | </ | ||
+ | The turtle command '' | ||
+ | |||
Now that we have specified the '' | Now that we have specified the '' | ||
- | By applying | + | By applying |
In tomato, after a certain number of phytomers (internodes with leaves), specified by a parameter '' | In tomato, after a certain number of phytomers (internodes with leaves), specified by a parameter '' | ||
Line 280: | Line 282: | ||
For an example on how to generate a leaflet mesh, see the tutorial [[: | For an example on how to generate a leaflet mesh, see the tutorial [[: | ||
+ | |||
+ | We use the code from the leaf triangulation tutorial to create a leaflet mesh '' | ||
+ | |||
+ | To use the leaflet mesh in our tomato model, we create a new module for leaflet: | ||
+ | |||
+ | <code java> | ||
+ | module Leaflet(double length) | ||
+ | ==> | ||
+ | RL(90) Scale(length, | ||
+ | ; | ||
+ | </ | ||
+ | |||
+ | Then we replace '' | ||
+ | |||
{{ : | {{ : | ||
+ | |||
+ | <code java> | ||
+ | module Leaf extends Organ | ||
+ | { | ||
+ | ... | ||
+ | } | ||
+ | ==> | ||
+ | ... | ||
+ | | ||
+ | // leaflet pairs | ||
+ | for (int i: | ||
+ | [RU(-80) RL(-30) Cylinder(0.04, | ||
+ | [RU( 80) RL(-30) Cylinder(0.04, | ||
+ | RL(20) | ||
+ | Cylinder(segmentLength, | ||
+ | ) | ||
+ | // terminal leaflet | ||
+ | Leaflet(segmentLength) | ||
+ | ; | ||
+ | </ | ||
+ | |||
tutorials/simple-tomato-model.1733581810.txt.gz · Last modified: 2024/12/07 15:30 by ksmolen