LeafGen is a MATLAB package containing methods for generating virtual foliage on 3D tree models based on parametric leaf distributions. The tree models can be either quantitative structure models (QSM) or point clouds of trees. The user can choose parametric distribution functions on variables of tree structure for the leaf area density distribution (LADD), leaf orientation distribution (LOD), and leaf size distribution (LSD).
The general LeafGen framework is presented in the following article
- Mönkkönen P, Van den Broeck W, Ali-Löytty S, Calders K, and Raumonen P (2025). LeafGen: Foliage Generation in 3D Tree Models. Methods in Ecology and Evolution. https://doi.org/10.1111/2041-210X.70080.
For technical details and guidance on usage, see the LeafGen documentation.
To quickly test running the method:
- Download or copy the LeafGen repository to your computer.
- Open MATLAB and set the main path to the
srcdirectory of the LeafGen repository - Open and run one of the three main files in MATLAB (preferably start with either
main_qsm_direct.mormain_canopy_hull.m, as themain_leaf_cylinder_library.mrequires a long computation.)
To view a detailed tutorial on each of these files and more, see the LeafGen documentation.

