User Tools

Site Tools


tutorials:qsm:to-growable

This is an old revision of the document!


Turning a QSM into a growable model

In the following tutorial we will take a small QSM file, transform the existing cylinders into modules and add additional organs(Buds, Needles) in order to simulate simple growth based on a measured dataset.

Shoots

In order to add more variables or functions to the individual shoots, we first turn our imported shoots into our own kind of shoots. For now the module MyShoot can be very simple (basically just a brown cylinder):

module MyShoot(super.length, super.diameter) extends F{{setShader(EGA_6);}}

To use these new shoots we need a rule to turn all imported F's into MyShoot's of the same length and diameter.

f:F ==> MyShoot(f.length,f.diameter);

Yet there is an important addition here, that is different to normal L-System rule: we need to keep the local transformation that keeps the cylinders in place.

We can do this by applying an expression directly to the newly created shoot using '.()'. In this expression we set the transform value of the new object(represented by the $ sign) to the value of the old object.

f:F ==> MyShoot(f.length,f.diameter).($[transform]=f[transform]);

Adding buds

Apical

Lateral

Adding needles

tutorials/qsm/to-growable.1760362285.txt.gz · Last modified: 2025/10/13 15:31 by Tim