Generate a 3D tree model that is based on different environmental factors.
Just download the executable for your system from the latest release.
Setup:
git clone https://github.com/philipp-schuetz/tree-growth-simulator
pip install -r requirements.txt
Run:
- run main.py in /src
The API provides a web interface for generating the tree models.
A local installation of the tree-growth-simulator is therefore not required.
Visit the API docs here: https://tgs.philippschuetz.com/docs (this instance is no longer maintained)
You can also host a version of the API yourself with Docker. Build the image with docker build -t tgs-img .
and run the container with docker run -p 80:80 tgs-img
.
After the container is started, the docs can be accessed here: http:https://127.0.0.1/docs
Through the GUI, you can set the intensity of environmental factors, image creation of the results, start the simulation and show its results. If image creation is enabled, the images are created when clicking the show button and saved in a folder named plots.
With the help of the config file, even more settings can be adapted to your needs. The default configuration will be created on application startup in config.json
. After an update, you might want to backup your current configuration and regenerate it by starting the updated app to get the newest configuration options.
The material id is the number used to identify each material in the numpy model array.
"material_id": {
"air": 0,
"wood": 1,
"leaf": 2,
"wall": 3
}
Material describes the translucency of each material and can therefore be used to influence the light calculation.
"material_translucency": {
"air": 100,
"wood": 0,
"leaf": 50,
"wall": 0
}
By changing the width and height of the model, the size of the 3D array is changed.
"model_dimensions": {
"width": 249,
"height": 498
},
With the visualization options, the material colors used for plotting and the filename of the plot images can be changed.
"visualization": {
"material_colors": {
"wood": "brown"
},
"plot_filename": "plot"
}
This setting can be used to better control the behavior of the different modifier values. In this example, the minimum value needed to start generation for each of the modifiers is set to 20 percent.
"light": {"minimum": 20}
"water": {"minimum": 20}
"temperature": {"minimum": 20}
"nutrients": {"minimum": 20}
The logging
value can be changed to either enable or disable logging.
The value of random_seed
can be set to false
or any integer
. If the value is set to an integer, it is used as the seed for any random number generator in the program. When set to false, the system time is used as the seed.
When changing the boolean value of save_array
to true
the array created on runtime is saved to a file, model_array.npy
by default.
"logging": true
"random_seed": false
"save_array": false
If logging is enabled in the configuration file, certain events are logged to a file. This file is called logfile.log
by default. These events can include information about a finished process or error messages. This information is mainly used for debugging.
Licensed under the GPL-3.0 license.