This is a look into how Cut and Fill works in PVFARM, for further insight please see the attachment at the bottom of this article.

# Surfaces

In PVFARM, surfaces can be imported either through a Civil 3D plugin or by loading a GeoTIFF file.

Please dive into the Importing Surfaces article for details.

In PVFARM, the surface is represented as a rectangular grid for visualization and analysis, even if the original grid from Civil3D is triangular. The default discretization step for constructing the rectangular grid is 0.5 meters. For large surfaces (exceeding 20 square kilometers), this step can be increased to 2 meters.

It should be noted that while the original triangular grid provides a more accurate representation of complex surfaces with sharp elevation changes, the reduction in accuracy from using a rectangular grid is typically within the error margin of the actual method used to obtain the surface.

# Cut and Fill Calculation

Cut and Fill calculations are carried out on a 4-meter grid, as the construction equipment used for cut and fill (grader machine moldboard/blade) cannot ensure an accuracy of less than 4 meters.

# Optimization

Within the user-defined boundary on the surface, an optimization problem is solved.

The node heights of the surface grid are determined such that:

`Cut Volume + Fill Volume โ MIN`

under the following restrictions:

`Cut Volume - Fill Volume = NET Balance`

The solution to this optimization problem is a new surface, the nodes of which satisfy the specified above conditions.

# Volume Calculation

The volume of earthworks is subsequently calculated as the difference between the original surface and the surface generated from solving the optimization problem.