Tree Library

Having a tree model for each genus is not feasible, enven less for each species. That being said this is not really an issue since what we’re interested in is the shape of the tree and this shape can vary greatly within the same genus depending on the age of the tree, the environment, the care it received, etc.

For now will assume that the trees belong to a specific shape category, in our case cone, oval or round. This could be improved by adding more shapes as shown in the next image:

Different types of the trees shape
Figure 1. Different tree shapes (source)

If we had acces to an image of the tree we’re trying to model, we could use Deep Learning to classify the tree and then use the appropriate model. This would be a great improvement to our current method.

For all tree LODs we will separate the tree into two parts: the trunk and the foliage. The trunk will be a simple cylinder, while the foliage will be a more complex geometry. This will allow us to treat the foliage separately which will be useful for scaling and when considering different leaf densities.

1. LOD 0

For the lowest level of detail, we will use simple models manually made with Gmsh and store them in data/vegetation/tree_ref in stl format. The .stl (stereolithography) format is widely used for 3D printing and computer-aided design (CAD). It represents the surface geometry of a 3D object without any color, texture, or other attributes. The file comprises a collection of triangular facets, each defined by its vertices and normal vector.

In the following images, we can see the trunk and foliage of the tree, with the trunk separated from the foliage:

Table 1. 3D model of a tree trunk and different foliage shapes
tree trunk
cone
oval
round

Trunk

Cone shapped tree

Oval shapped tree

Round shapped tree

2. LOD 1, 2, 3

For the other LODs, we will retrieve reference tree meshes from the Sketchup 3D Warehouse:

ginkgo sketchup
Figure 2. Mesh of a Ginkgo tree on Sketchup 3D Warehouse

We will then pre-process these models using Meshlab, removing the trunk and branches as much as possible. Additionally, we will normalize them to fit within a unit bounding box and translate them to the origin. These cleaned models will be stored in the data/vegetation/tree_ref/tree_ref_sketchup directory.

The results are as follows:

Table 2. 3D models of pre-processed trees
tree conifer
tree ginkgo
tree quercus

A cleaned up conifer (Cone tree)

A cleaned up Ginkgo (Oval tree)

A cleaned up Quercus (Round tree)

Finally, using the CGAL 3D Alpha Wrapping algorithm (explained in Alpha Wrapping), we will generate reference tree meshes for each shape at execution time. This pre-processing ensures that the meshes are readily available in memory, eliminating the need to wrap and write a .stl file each tree model individually during program execution.

The following images illustrate the results of the wrapping algorithm for different alpha values (cf Alpha Wrapping) on our different tree models retrieved from Sketchup. The trunk is separated from the foliage, each image is composed of two parts: the trunk and the foliage:

Table 3. Diffent level of detail of a cone shaped tree
tree cone lod1
tree cone lod2
tree cone lod3

Cone shaped lod1

Cone shaped lod2

Cone shaped lod3

Table 4. Diffent level of detail of an oval shaped tree
tree oval lod1
tree oval lod2
tree oval lod3

Oval shaped lod1

Oval shaped lod2

Oval shaped lod3

Table 5. Diffent level of detail of a round shaped tree
tree round lod1
tree round lod2
tree round lod3

Round shaped lod1

Round shaped lod2

Round shaped lod3

We used the following alpha values for each LOD:

Table 6. Used alpha values for each LOD
Tree LOD 0 LOD 1 LOD 2 LOD 3

Alpha

Nan

20

50

100

(Reminder: LOD 0 is made with Gmsh not with the Alpha Wrapping algorithm.)

3. Number of Faces

In simulation software, the number of faces in the mesh is crucial for performance. The next table shows the relation between the LOD and the number of faces for each tree shape:

Table 7. Number of faces for each LOD
Tree LOD 0 LOD 1 LOD 2 LOD 3

Trunk

28

28

28

28

Cone

72

894

6038

34260

Oval

52

1260

9254

44942

Round

30

1198

10152

45164

4. Leaf Density

As seasons change, trees undergo various stages of growth and leaf shedding. To simulate these changes, we will implement different leaf densities for the tree models. This will allow us to adjust the foliage’s appearance and complexity based on the time of year.

To achieve this, we will iterate over the triangles of the tree’s foliage and randomly attribute a marker to each triangle (=leaf). Choosing how many markers we want to keep will allow us to control the leaf density.

By incorporating different leaf densities, we can enhance the visual realism of the simulation and capture the dynamic nature of trees throughout the year.

ginkgo tagged
Figure 3. Tree with tagged leaves

References