Tree Scaling

1. Tree Scaling Overview

In order to scale the trees to match real-world dimensions, we utilize tree attributes retrieved from OpenStreetMap data:

  • height: the height of the tree in meters.

  • diameter_crown: the diameter of the crown in meters.

  • circumference: the circumference of the trunk in meters.

We assume these attributes exist and are correct. Before scaling the tree, we add a random rotation to enhance realism.

1.1. Scaling Process

The next step involves scaling the tree to match its real height. This is achieved by scaling the foliage and trunk separately:

The foliage is scaled using the diameter_crown attribute while the trunk is scaled using the circumference attribute.

Table 1. Foliage and trunk mesh
foliage arrows
trunk arrows

Foliage

Trunk

The diameter_crown attribute varies depending on the shape of the tree, as illustrated in the following images:

Table 2. Diameter of a different foliages
diam foliage round
diam foliage oval

Round foliage

Oval foliage



The scaling factor for the foliage (or trunk) is calculated as follows:

scaling factor = (diam_foliage (or trunk)) / (bbox.ymax() - bbox.ymin()) + noise

Where:

  • diam_trunk = circumference / π is the diameter of the trunk.

  • bbox.ymax() - bbox.ymin() is the width of the bounding box.

  • noise is a random value in the range [-scaling factor / 100, scaling factor / 100].

If the circumference (or diameter_crown) attribute is not available, we use the scaling factor obtained from the other attribute to scale the tree. If both attributes are missing, a default height value is used, as specified in the config.json file.

References