Skip to content

master-csmi/2024-m1-vegetation

Repository files navigation

ExaMA - Vegetation

Overview

The goal of this project is to develop a tool that integrates trees into 3D urban models to improve the efficiency of thermal simulations. This project is part of the HiDALGO2 initiative, which aims to explore synergies between modeling, data acquisition, simulation, data analysis and visualization, with focus on improving building energy efficiency and indoor air quality.

Installation and Usage

Required Packages

To build the project, you either need the following packages or you can use the provided Docker container:

Installating package on Ubuntu

sudo apt-get update
sudo apt-get install -y build-essential cmake git libmpfr-dev libboost-dev libcurl4-openssl-dev libfmt-dev

Install CGAL

For our project, we need the master branch of CGAL:

git clone --branch master https://github.com/CGAL/cgal.git
mkdir cgal.build
cd cgal.build
cmake -DCMAKE_INSTALL_PREFIX=path_to/cgal.install ../cgal
make install

Alternatively, using the Docker container:

This container can be used for developpement, when building the image the project is copied in the container without building the project.

You might want to remove the build directory before running (and closing) the container to avoid conflicts.

docker build -t 2024m1vegetation:latest .
docker run -it 2024m1vegetation:latest

On VsCode you can use the Remote - Containers extension to reopen the project in a container.

Build the Project

Configure and build the project using CMake:

mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=/workspace/cgal/cgal.install ..
make

# Run the tests
ctest

Note : this is the path used in the Docker container, you might need to change it to your own path.

Usage

Use the configuration file config.json to specify:

  • bbox: The bounding box of the area of interest ("bottom latitude, bottom longitude, top latitude, top longitude")

  • origin: The origin used in the conversion from latitude and longitude to Cartesian coordinates

  • LOD: The level of detail (0, 1, 2, 3) of the meshes

  • altitude: The altitube of the area of interest (in meters)

  • default_height_range: The default height of the trees (in meters) when the height is not available in the OpenStreetMap data

  • default_genus: The default genus of the trees when the genus is not available in the OpenStreetMap data

  • input_building_mesh: The input building mesh file for merging the buildings with the trees

  • merge_builtings_trees: Boolean to merge the trees with the buildings or not

  • output_file: The base name of the output file saved in the /output directory

Use the genus.json file to specify the genus and height of the trees to be used in the simulation.

  • known_genus: A list of genera for which we have a base mesh

  • cedrus_like: A list of the genera for which the cedrus mesh model will be used

  • etc.

To mesh your own tree model using CGAL Alpha Wrapper run:

./build/wrap Genus.stl <alpha> <offset>

Move the result to the tree_ref directory and add the genus to the known_genus in the trees.json file.

Finnaly run the program:

./build/src/run

The output mesh and some metrics will be saved in the /output directory (which is automatically created if needed).

You can visualize the output mesh with Meshlab, Paraview or any other mesh viewer.

Contributors

References

For detailed information on the project’s context, objectives, methodology, and implemenation, please refer to the accompanying report.