A program to generate simple tree models for lighting simulations based on gap fraction measurements and tree shape & dimension.
The code is licensed under GNU. For use of the code in research, kindly cite our associated publication Measuring light through trees for daylight simulations: a photographic and photometric method.
Generate tree crown models based on four shapes:
- Truncated ellipsoids (Prolate and Oblate ellipsoids)
- Truncated cones
All code is provided in the gen_tree folder.
How to use
- Download the code using
git clone https://github.com/C38C/gen_tree.giton the command line/Terminal.
- Run main file with
python main.py, using the necessary generating function in the file for the desired shape (
- Results are stored in an
output/folder that contains:
<shape_name>.objfile, for use with any 3D CAD program (e.g., Rhino),
<shape_name>.radfile for Radiance,
<shape_name>PointCloud.csvfile with the initial vertices coordinates.
The code has some default values to generate a tree crown model in the shape of a hemisphere, truncated cone, ellipsoid prolate and ellipsoid oblate.
To create your own tree you will need:
vertices_countwhich determines the number of triangles that make the tree crown model. A good number to start with is 20,000.
gap_percentagevalue, which indicates the transmittance characteristics of the tree crown. If you have a gap percentage of 10% then input the value as 0.1 in the code. Some measured gap percentages of tropical trees are given below. Follow the published paper to measure gap percentages of trees.
Depending on the shape you decide for the tree crown, you will need either the
heightof the crown.
|Common name (scientific name) of tree||Gap Percentage||Tree crown shape|
|Sandbox Tree (Hura Crepitan)||10.7%||Hemisphere|
|Star Apple (Chrysophyllum Cainito L.)||8.8%||Hemisphere|
|Bornean Rhu (Gymnostoma Nobile)||17.8%||Cone|
|Rain Tree (Samanea Saman)||7.4%||Ellipsoid Oblate|
|Red Frangipani Tree (Plumeria Rubra)||16%||Ellipsoid Prolate / Oblate|