All software will give errors messages from time to time, and Kubla Cubed is no different. In this post we discuss the ‘Calculation Error’ message which can sometimes occur when working on complex projects in Kubla Cubed. We also discuss the calculation steps used by the software, and some of the new error reporting features that were introduced to the software in Version 5.7, released in July 2019.

This post is mostly targeted at experienced users of Kubla Cubed, and contains discussions of quite advanced topics.

Calculation error messages are displayed in Kubla Cubed where the calculations fail, or where a validation step fails. Validation steps are run at numerous points during the calculation to ensure the integrity of the final result.

No calculation engine is going to be entirely free of errors, and especially not one whose calculations are based on Triangular Prisms, like Kubla Cubed. This method is the most accurate, but is also far, far more technically challenging than the grid and cross-section methods that are used by some other earthworks software.

Kubla Cubed allows users to create as many phases of work as they wish, with each phase containing an unlimited number of earthworks elements. This provides a great deal of flexibility to our users. However, it also allows for very complex projects to be defined, increasing the likelyhood of calculation errors when compared to more restrictive software.

In order to understand the sources of calculation errors, it helps to understand the steps involved in the calculation. We will briefly summarise the process below. These steps are repeated for each phase in the project.

For each earthworks element in a phase, there is a three step process:

- Generating the surface mesh. For a platform, this is trivial and unlikely to cause an error. However, it is potentially quite complicated for a feature surface with many ground features. It can also be challenging for an strip or overlay, where the ground below is complex.
- Generating batter slopes. These are the side slopes that will be used to connect the surface mesh to the terrain. The complexity of this process depends largely on the complexity of the outline of the element. However, if the batters are set to vertical this step is quite straightforward for the software to complete.
- Merging the element with the terrain. This is usually a fairly challenging step for the software, and particularly if the existing and/or proposed meshes are complex.

Once all of the earthworks elements have been processed in this way, the will be 2 meshes; the mesh at the start of the phase, and the mesh after all the elements have been merged into it. The final step is to project the initial mesh edges onto the final mesh. This will create a mesh which contains all the edges of both the initial and the final meshes. This ‘Calculation Mesh’ is used to generate volumes, and to present cut and fill maps. This final step of the process is extremely complex and is one of the most common sources of errors.

If an error occurs when merging an earthworks element into the terrain the software will identify the element that caused the error. However, if an error occurs when generating the calculation mesh, it is not possible to identify a specific element that has caused the problem. For this reason, these errors can be particularly difficult for our customers to resolve with the current error messages.

*Step 1: A surface mesh is created for the element based on the features defined by the user.*

*Step 2: Batter slopes are generated to join the element to the terrain, based on the batter angles specified by the user.*

*Step 3: The element and slopes are merged into the terrain.*

At Kubla we use the following approaches to minimise the frequency and impact of calculation errors:

- Thorough validation of the data that is input by the user. This minimises the likelyhood of situations that will cause errors.
- Continual improvement to make the calculations as robust as possible. Our developers are constantly working through calculation errors reported by users, and fixes are included in regular software updates.
- Presenting error details to the user about errors when they occur, to enable them to resolve the issues themselves.
- Directly supporting customers who run into calculation errors.

We believe that our validation, calculations and support are amongst the best available in the industry, although we continue to improve these areas. However, it has become clear that our users are often finding that when error messages occur they are difficult to make sense of, and do not always provide enough information for them to find a solution on their own. For this reason, the latest release of the software includes work to improve this aspect of the software. This work is ongoing and will continue in subsequent updates.

*The validator in Kubla Cubed aims to prevent errors in the terrain definition. It will block blatant errors, such as contour lines crossing each other with different levels. It will also warn the user about likely errors, such as one elevation which is very different from all of the others.*

In earlier versions of the software, only one error message could be displayed to the user. This provided limited ability for our developers to communicate the source of the error to the user of the software. One major upgrade to error reporting is to present the full error path to the user, which allows for much more detail about the error to be communicated to the user.

However, the most significant improvement to error reporting is the ability to display the region in which the error has occurred on the screen. This allows our users to inspect the problem area, and see if they have made any mistake, or if they could simplify the way they have defined the ground levels in this area. Sometimes even just moving some features in this area by a negligable amount may cause errors to go away.

However, it’s important to understand, that due to the complexity of the calculations it’s not always obvious where they have initially gone wrong. The error regions displayed will sometimes represent a ‘best guess’ of the location of the source of the error. The project should be checked in the vicinity of the identified error region, as well as within the region itself. It should also be noted that it is not possible to identify an error region for every type of error, and it will not always be displayed. However, the most common errors will now have error regions, and coverage will be expanded to more error types in the future.

*The ability to view the error region, as well as the full error path are two significant upgrades to error reporting in Kubla Cubed*

The grid method involves drawing a uniform grid onto a plan of the earthworks project, and taking off the existing and proposed ground levels at each node of the grid. With these values the average depth of cut or fill required on each cell of the grid is calculated, and the volume for each cell is obtained by multiplying the depth by the cell area. By adding the volumes for each cell together the total cut and fill volumes for the project can be estimated.

We have discussed the grid method in detail, as well as the alternative cross-section method in a previous post. If you are not familiar with this method we recommend you read the post linked at the bottom of this page before continuing to read.

**The average cut or fill depths are determined for each cell in the grid. From these depths the volumes of each grid cell can be calculated, and by adding the cell volumes together the total cut and fill volumes are obtained **

The most obvious factor that will influence the accuracy of the grid method is the size of the grid squares that are used. The smaller squares that are used, the more accurate the method would be expected to be. However, this is a manual method, and the number of grid squares also has a huge impact on the amount of time it takes to generate the estimate. There is therefore a balance that must be struck between accuracy and speed.

This is one of the factors that makes it difficult to answer the question of how accurate the method is, since it’s highly dependent on the density of the grid.

In order to provide some guidance, we have performed calculations on a number of projects, and based on grids of various densities. This should enable us to see typical accuracies that may be achieved at different grid densities.

**Example project.**

**Example project gridded with 100 grid points inside the cut/fill area.**

*Example project gridded with 1000 grid points inside the cut/fill area*

The accuracy of the grid method at different grid densities have been compared on ten real-life project examples. These projects have been selected to represent a variety of project types, and vary greatly in project complexity.

The calculations based on the grids have each been compared to a calculation based on triangulated meshes. This method is mathematically exact, because it contains every facet of both the existing and proposed surfaces. However, it should be noted that this is a mathematical comparison only; it cannot and does not represent any inaccuracy that may occur due to surveying of the site, estimates of earth bulking, etc.

Three key parameters have been checked: The cut volume, the fill volumes and the net volume. The accuracy values given in the graph below represent the worst of these three values, expressed as a percentage of the total earthworks volume.

*Comparison of estimate accuracy vs. grid density for 10 real-life projects. The number of points refers to the number of points landing within the earthworks region. The grids used were oriented horizontal-vertical. A line has been drawn on one of the projects to demonstrate how erratic the trend can be.*

The graph above showed some examples which were not only much less accurate than others, but also much less predictable. In other words, increasing the grid squares did not always improve the accuracy, although the general trend was always for it to improve as the grid density increased.

Inspection of these erratic examples revealed that they had something in common. They had retaining walls that ran vertically up the site boundary. Since the grids in the comparison above were orientated horizontally and vertically, this meant that the retaining walls aligned with the grid. This is not particularly unusual, since project drawings are often orientated to site boundaries and these often have retaining walls at the boundary.

It makes sense that this could cause the outcome to become unpredictable. Retaining walls naturally pose a challenge for the grid method, since the sharp change of levels can cause a grid square to be unrepresentative of the true terrain. For example, if 2 corners of a grid lie on one side of a wall, and two on the other, it may be that there is significant cut on one side of the wall, and significant fill on the other. However, since values are averaged over the grid square, the result will be little or no earthworks for this square.

The problem with the grid aligning with the wall is that rather than this happening for one grid square, the same issue can occur for a number of squares, magnifying this inaccuracy. Therefore the accuracy becomes highly dependent on how the grid points happen to land with respect to this feature.

In order to investigate this effect, the comparison was repeated, but orientating the grids for each project based on inspection of the projects. The grids were rotated to try to avoid alignment of the grid with the most significant project features, in terms of any steep changes in the ground levels.

*The same comparison repeated with the grids rotated to avoid alignment with major ground features. These results show an improvement in accuracy and predictability compared to the graph above.*

Based on these project examples, we can draw the following conclusions:

- The grid orientation has a significant impact on accuracy and predictability. It should be oriented to avoid retaining walls and other steep changes in ground levels. Note that rotating the grid by 45° will not achieve this, as the points would still land in a consistent way with respect to the wall. For example, if there’s a major feature that runs vertically up the site, it may be appropriate to align the grid at 30° to horizontal;
- If oriented this way, you can expect to achieve accuracies within 5% with a few hundred grid squares inside the earthworks region. In all examples considered, 5% accuracy was reached at 500 grid squares, and in most examples it was achieved with 250 squares;
- Even with the grids orientated to avoid major features, there is significant variability in the accuracy between projects. Inspection of the projects suggests that those with stepped ground profiles are the hardest to resolve accurately with this method, whereas those with smooth profiles are easier. This is logical, given that the grid method has an averaging effect which will smooth out the ground profile.

- There is a post which covers the manual methods of earthworks calculation here.

The cross section method involves plotting cross sections of the existing and proposed levels at regular intervals across the project site. For each of the cross sections, the cut area and the fill area is determined. The volume between each pair of sections is estimated by multiplying the average cut or fill area of the two sections by the distance between them. Once these volumes have been calculated for each pair of sections the total cut and fill volumes are obtained by adding them all together.

There are several different methods used to determine the areas of cut and fill once the sections have been plotted. Perhaps the simplest (but most time consuming) method is to plot the sections on gridded paper and count the grid cells of the cut and fill areas. Multiplying the cell count by the area represented by each of the grid cells gives the cut or fill area for the section. Other methods include drawing the sections in CAD and exporting areas or calculating areas mathematically using the trapezoidal rule. The spreadsheet included with this article includes formulae which have automated the process of calculating section areas using the trapezoidal rule. This can save a great deal of time if you are using the cross section method.

The accuracy of the cross section method depends to a large degree on the distance you choose to set between the sections. Closer sections improve the accuracy of the estimate, but take longer to estimate. A balance has to be made between accuracy on the one hand, and speed of generating the estimate on the other.

One of the great advantages of this method is that cross sections are generated in the process. These provide a useful visual summary of the estimation, which present the cut and fill depths across the project in a very clear way. One of the disadvantages off the method is that it can be extremely laborious to extract cross sections from the drawing, and to determine the areas of the sections.

*Sections are drawn at equal intervals through the project. For each section line the cut area and the fill area is determined. The volume between two sections is determined as the average area of the two sections multiplied by the distance between them. By adding together the volumes between all of the sections the total cut and fill volumes are obtained. *

**An example calculation for the volumes between two sections of the example shown opposite. This calculation is repeated for all of the sections, and the values are added together to get the total cut and fill volumes. **

The grid method involves drawing a uniform grid onto a plan of the earthworks project, and taking off the existing and proposed ground levels at each node of the grid. With these values the average depth of cut or fill required on each cell of the grid is calculated, and the volume for each cell is obtained by multiplying the depth by the cell area. By adding the volumes for each cell together the total cut and fill volumes for the project can be estimated.

The cut or fill depth for each cell is found by subtracting the average existing level of the cell from the average proposed level. If the resultant depth is positive then this is a fill cell, while a negative value indicates a cut cell. In either case, the volume is calculated by multiplying the cut of fill depth by the area of the grid cell.

Once the volume has been calculated for each grid cell, all of the cut cells are added together to obtain the total cut volume. The same is done for the fill cells to get the total fill volume.

As with the cross-section method, the accuracy of the grid method depends upon the size of grid cell which is used. A compromise has to be made between the accuracy which is required, and the time which will be taken to produce the estimate.

An advantage of the grid method are that the basis of the estimate can be fully summarised on the site drawings, which presents a very clear summary of the calculations for others to check. One of the disadvantages are no graphical summary is generated for the estimation. Also, like the section method, the grid method is time-consuming and tedious to implement.

**An example calculation of the volume for one of the grid cells in the example above**

The third method that is commonly to used to calculate earthworks volumes is the triangular prisms method. This is by far the most technically difficult method, but is also the most accurate.

This method starts by triangulating the existing terrain. This involves joining the points in the terrain to create a continuous surface of connected triangles. This is known as a Triangulated Irregular Network, or TIN for short. This step is repeated for the proposed terrain.

The next stage is to merge these two triangulations, to create a third triangulation which contains all the edges of the original triangulations. This will be used to perform the calculations, and merging the two input triangulations means that every detail of both the existing and the proposed will be included in the calculations. This is the basis of this method’s accuracy.

The last stage is to calculate the cut and fill of each vertex on the calculation TIN. These values can be used to calculate the cut and fill for each triangle, and the total volumes are easily obtained by adding all the triangles together.

Due to the great complexity of these calculations and the thousands of triangles that are generated it is not practical to calculate triangular prisms by hand. Instead, these calculations are done with specialised software like Kubla Cubed. However, it should be noted that not all earthworks software uses this method; some software calculations are based on automated high-density grid calculations or the cross section method used in conjuction with TINS.

There are several great advantages to the triangular prism method. First and foremost, this method is the most mathematically complete of the three. Since every detail of the existing and proposed terrain is retained in the merged triangulation nothing is lost in these calculations whereas all other methods accept a certain degree of loss due to details falling within the density of the grids or cross sections.

Another advantage of this method is that you can represent the finest level of detail, even if a site is very large. Using both the grid and cross section methods you have to define the density of the grid squares or sections, and any detail that is within this spacing is liable to be lost. With the triangular prism method, on the other hand the finest level of detail can the represented even in very large sites, as having a high density of triangles in one area does not have the knock on effect of requiring other areas of the site to have the same detail. This means that even on a very large site you can represent a small trench without any loss of accuracy.

**Triangulation of existing terrain. Note the smaller triangles in areas where more detail is required. The proposed surface is triangulated in the same way.**

**Merged triangulation, which contains all the edges of the existing and proposed triangulations. The fact is key to the accuracy of this method, as all the features of both surfaces will be represented in the calculations**

**A secondary benefit of any software-based solution is the speed of input and the ability to view 3d images to validate results.**

Welcome to the Kubla Blog!

This is where we post content that we think will be interesting to users of our software, and others in the industry.