Methodology¶
Key Definitions¶
Terrain survey¶
A process by which points are collected from a terrain of interest in order to form a representation of it.
Ground leveling¶
In the context of construction, ground leveling is a process by which a given terrain can be re-shaped to a desired projected shape, slope or level. It is usually carried out by the use of heavy machinery to move terrain materials either from the inside the terrain (redistribution of soil) or by using material from the outside.
Cut/Fill volumes¶
In the context of ground leveling, cut volume refers to terrain material that needs to be removed in order to contribute to re-shape the terrain a new desired state. It is about removing excess. Conversely, fill volumes represent material that needs to be added to the terrain towards achieving this same goal. In practical terms, it is about covering the holes in the terrain.
Volume Calculation Method¶
During most undergrad studies people are taught how to calculate integrals on a number of different equations. But the real world doesn't give us equations, we need to come up with the equations to model it. This was one of the most delightful pieces of this project: translating a set of points in space into equations and applying basic concepts of linear algebra and integral calculus to them to obtain volumes and cut/fill curves that can be put to practical use in construction work involving earthworks.
In a Nutshell¶
- From points to a triangles.
- From triangles to plane equations.
- From triangles and planes to a sum of volumes.
Step 1: From points to triangles¶
The sequence of points in 3D space represented each by an (x,y,z)
triplet is grouped in a mesh grid using Delaunay triangulation in the (x,y)
coordinates. This process outputs a collection of points grouped in 3 sets of 3d coordinates, each representing a triangular plane in 3d space:
This is what it looks like when viewed from the top:
Step 2: From triangles to plane equations¶
The plane equation z=f(x,y)
is obtained for each group of 3 distinct points (triangles) in 3d space by applying some basic linear algebra. Given the previous collection of points [A, B, C]
in the cartesian system:
- Vector AB and BC are determined using their coordinates.
- The cross product AB x BC generates a perpendicular vector represented by numerical constants
(p,q,r)
. - Finally the corresponding plane equation is given by:
where (xo,yo,zo)
can be any one of the 3 A, B or C points from the plane.
In the GIF below, the ABC triangle is represented by the blue points and the orthonormal vector (p, q, r)
is represented by the blue line with an orange tip.
Step 3: From triangles and planes to a sum of volumes¶
Given the plane equation, we can isolate z and obtain a z=f(x,y)
function on top of which the double integral is applied in order to calculate the volume beneath the triangular plane down until the plane perpendicular to the XY axis that passes by the lowest elevation coordinate (z) of the survey.
The volume of each individual triangle is obtained by the sum of 2 double integrals. So for a triangle with vertices ABC and its plane determined by z=f(x,y)
the double integral limits for a single triangular area are determined as follows:
From GPS to Cartesian Coordinates.¶
In the event of the terrain survey being executed thru a GPS device (the most common case) an extra step is required prior to applying the volume calculation: map projection.
For the purpose of this project the Universal Traverse Mercator was used to convert from GPS coordinates (latitude, longitude, elevation) to a Cartesian coordinate system which is expected by the algorithm in step 1.