Posted on

Estimating Pipe Trench Excavation Material Storage Capacity

Estimating Pipe Trench Excavation Material Storage Capacity

About a year ago we were approached by an international company which among many other things constructs pipelines, and uses AutoCAD Civil 3D to model their projects. This involves excavating a trench, which of course produces a significant quantity of excavated material which must be stored somewhere until it can be reused as backfill after the pipe is installed. Typically, the material is stored as a berm adjacent to the excavated trench. This minimizes movement of the material on the job site, and keeps expenses to a minimum. The catch is that sometimes space for the berm is limited by right-of-way boundaries, and there are geometric constraints which must be met when constructing the berm as well. In cross section, a typical project looks something like this:

Cross section in C3D

The problem this particular customer was facing is that there are no subassemblies included with AutoCAD Civil 3D which:

  • Models a pipe trench that meets their specifications
  • Models a pipe trench which automatically reacts to the pipe diameter by resizing
  • Calculates a material area in the subassembly that is usable from another subassembly
  • Calculates the size of a berm based on the desired geometric constraints and the total area of the material used to construct it.

For this customer, not having the proper subassemblies ultimately resulted in them having to use Microsoft Excel to perform their storage capacity calculations. A section of pipeline several kilometers long could easily take several weeks to model and quantify. This process was also highly prone to mistakes. In fact, when we first started testing the solution we are about to describe, we noticed a mistake the customer had made a week prior when beginning his manual calculations that significantly altered the results he was getting, and would have resulted in a grossly erroneous bid for the project.

The Solution

The solution to this challenge involved the use of several of our applications. We used Subassembly Studio to create the custom subassembly which modeled both the trench and the berm. We then used Visual Report Designer to create a custom quantities report which also included a chart to visualize the results. Last, we used Terra Power Tools to visualize the models and materials in 3d, and to double check volumes.

The Custom Subassembly

custom subassembly in Subassembly Studio

We used several advanced techniques within subassembly studio to model the pipe trench and the berm. We also included a horizontal link which is conditionally coded based on whether we are under/over storage capacity (allows us to see hatched regions where capacity is insufficient in plan view), and a bar chart in the subassembly itself that shows the relative values of the various quantities calculated in the process of modeling this:

  • Raw excavation volume
  • Excavation volume with an expansion factor applied
  • Maximum storage capacity
  • Used storage capacity (with compaction applied)
  • Remaining storage capacity/overage

The subassembly is created as a composite subassembly. The bulk of the logic and geometry is implemented in the main subassembly, and the bar chart component is implemented as a separate subassembly which is ‘invoked’ within the main subassembly.

Implementation of the subassembly followed this general progression:

  • Create the trench geometry (including the pipe)
  • Calculate the excavation area from the trench geometry
  • Locate the storage berm extents
  • Determine the storage berm geometry based on the calculated excavation area (with factors applied)
  • Conditionally set the horizontal link coding to reflect the current state of the section (i.e. over/under capacity)
  • Invoke the bar chart component to enable the user to visualize the local results in each section view.

Subassembly Studio offers several unique features which make this sort of subassembly possible. The most critical feature is the ability to calculate the area of polygons defined from shapes. Without this one feature, none of this would be possible.

The Corridor Model

Corridor model in AutoCAD Civil 3D

With the subassembly completed, we were then able to model the geometry in AutoCAD Civil 3D as a corridor entity. The model shown above allows us to see precisely where we have sufficient storage capacity and where we have too much material, thus necessitating a mass-haul calculation. The bar chart in the subassembly allows us to see relative capacities in section view, and in the section editor:

Corridor model in plan view and Section Editor in AutoCAD Civil 3D

The entire process of modeling the corridor took no more time than a simple roadway or pipe trench might take, nor did it require any special techniques or workarounds – we simply created the corridor entity, set the baseline parameters, assigned the assembly containing our custom subassembly to a region, set targets and let it build.

Calculating Quantities

We created a custom report using Visual Report Designer to calculate the quantities from this model:

Visual Report Designer - Report Template

The report contains several notable features:

  • A bar chart to the report which shows remaining material storage capacity as a function of station.
  • Custom formatting on the bar chart shows remaining capacity in blue, and overages in red.
  • A warning icon is displayed in the section header if an overage is determined.
  • The body of the report shows a table for each station consisting of each pertinent quantity. The table shows the name, area, volume (end-area method), and ‘factored’ cumulative volume for each item.

When previewed, the report looks similar to this:

Visual Report Designer - Report Preview with Chart

At stations which have overages, the report looks like this:

Visual Report Designer - Report Preview with Warning Icons

Using Visual Report Designer instead of Quantity Takeoff (‘QTO’) in AutoCAD Civil 3D gives us several advantages. In addition to the graphics (warning icon and chart) that we included, we can add conditional formatting (note the red text in the screen capture above), and we can perform calculations within the report, as we did for the last column representing a ‘factored’ cumulative volume. We can also export the results directly to a PDF, XLS/XLSX, HTML, or any one of several other supported file formats. The results can also be printed, or embedded directly into the DWG.

We would like to note that for the customer to use this solution, it takes only a couple of minutes to create the model from existing alignment and surface geometry and ultimate get to these volume results. Compare this to the previous process which took several weeks to get to the same point.

Visualization and Composite Volumes

Using Terra Power tools, we can visualize our surfaces and materials (as solids), cut cross sections, etc. We can also calculate 3d composite volumes, which are more accurate and precise than end-area based quantities typically used for Quantity Takeoff (‘QTO’) in AutoCAD Civil 3D and in Visual Report Designer based quantity reports.

With ExistingGround turned off, the model looks similar to this:

Terra Power Tools - View Surfaces

We created a material table which results in materials being calculated for the ‘dump’ (storage berm), pipe, stripping layer, bedding, and for total excavation:

Terra Power Tools - Material Table

When we compute volumes, we get the following results:

Terra Power Tools - Volume Computation Results

The resulting materials can be viewed as solids in 3D:

Terra Power Tools - View Materials (solids) in 3D

We can also import the baseline alignment as a path and use it to cut profile and cross sections:

Terra Power Tools - View cross and profile sections with materials and surfaces shown

Posted on

Separating Earthwork Quantities by Material Depth

Separating Earthwork Quantities by Material Depth

A good friend in Sweden recently suggested we consider trying to solve the following problem which was vexing him at the time:

“In the Nordics there is a demand for separating areas and volumes if the rock cut depth is less or greater than e.g. 1 m. Normally the contractors are being paid by area if rock cut depth is less than 1 m. and by volume if greater than 1 m. Note that it is not the volume below 1 m. that is needed, it is all the volume in the area where rock cut is below 1 m.”

He further distilled the problem as follows:

Given an existing ground surface (EG), a rock surface (Rock), and a finished ground surface (FG), the following quantities would be of interest:

  • Ground cut volume and area: FG below EG but above Rock
  • Rock cut volume and area < 1 m. depth: FG less than 1 m. below Rock
  • Rock cut volume and area > 1 m. depth: FG greater than 1 m. below Rock

Before we begin to look at the solution, a few quick notes:

Let’s start by looking at a picture:

Cross sectional diagram showing relationship of surfaces and materials

Working in imperial units and using 5′ as our cut-off datum, if we offset the Rock surface by -5′ vertically, we can precisely define the region of space that is at a depth of 5′ below Rock. Let’s call this surface Rock-5. Now, wherever the surfaces Rock and Rock-5 intersect FG are points of interest (shown in the picture as vertical lines), since they indicate where the depth of material below Rock starts to increase beyond 5′ or reduce to less than 5′, and also where Rock itself starts to go below or rise above FG. Marking off areas between pairs of such points, we can easily isolate the regions where Rock is less than 5′ above FG. All the remaining regions where Rock is above FG are regions where the depth of material is more than 5′. Note that we’re not interested, here, in regions where Rock is below FG.

Now let’s see how we can use Terra Power Tools to get the correct volumes and areas of the materials that are pertinent to our problem:

3d view of surfaces

  1. We start off by creating the vertical offset surface, Rock-5, using the Create Vertical Offset Surface command, renaming the created surface Rock-5:

Offset ROCK surface

  1. Next, we use the very handy command, Create Split Surfaces, to split the surface FG into three different surfaces using Rock-5 as the splitting surface. These surfaces represent the regions of FG that are above, below, and outside the 2D bounds of Rock-5. The reason for doing this will be become apparent shortly.

Split FG surface aganist ROCK-5 surface

As shown below, the blue surface represents portions of FG that are above Rock-5 and the brown surface represents portions of FG below Rock-5. The portion of FG that is outside the 2D bounds of Rock-5, FG_Outside_Rock-5, is not pertinent to our problem.

Surfaces in 3D and Section

  1. We can now formulate our material definitions based on the following observations:
    1. We’re only interested in material that’s above FG.
    2. Anything above FG, but below Rock is Rock Cut material.
    3. Rock Cut material comes in two varieties:
      1. material that is above the surface FG_Above_Rock-5 (the blue line), and
      2. material that is above the surface FG_Below_Rock-5 (the brown line)
    4. Ground Cut is all material below EG, but above Rock (and of course above FG as well)

We can now define our material table as follows:

Material Table

Computing materials using the above definitions produces the following results:

Cross section showing materials

Volume computation results

Materials displayed in 3d as solids

Posted on

Parcel Area Tables with Summation and Grouping

Parcel Area Tables with Summation and Grouping

parcel area table document preview

If you have ever tried to create an area table for a collection of parcel entities in AutoCAD Civil 3D, you most likely share the same frustration we had with the process when we first tried it – there is no automatic way to sum the areas listed in the table. In order to achieve this seemingly simple thing, you must go through a convoluted process such as exporting to Excel, running the summation there, and then inserting the spreadsheet back into the drawing. We’ve seen others that just fill the table out by hand. Neither solution is particularly good.

Thankfully, there is another option, and it is actually quite easy to accomplish. The solution is to generate the table as a ‘report’ using Visual Report Designer , which allows you to create the table template using a drag-and-drop process, and includes easy to use summation and grouping features.

parcel area table - editing the report template in Visual Report Designer

The report consists of a header, which contains the table title (which is bound to a ‘Title’ parameter…more on this later), a ‘Detail Report’ band which is data-bound to the parcel entities in the current drawing, a group header band which shows column headers and the common value used to form the group, and finally a ‘Report Footer’ band which will be used to hold the grand total for the table. We will make this table report the area in two different units so it will work for both imperial and metric projects. We will also make it so that the user can choose what field should be used to ‘group’ the entities by. Note that in this example, we are intentionally not including a group subtotal – this will be left as a subject for a future post. Also, while the following explanation includes a significant amount of detail, actually creating the report takes only a few minutes, and there are areas which can be simplified or excluded entirely if desired but are included in order to demonstrate features/capabilities.

First, the report parameters:

Visual Report Designer - Parameter Collection Editor

We have two parameters in this report: Title and GroupBy.

Title is just an arbitrary text value and is used to set the displayed title in the generated report document…there’s nothing particularly special about this.

GroupBy is a little different. This parameter will be used to select which parcel field should be used to group the parcels. We’ll implement this as a ‘static list of values, meaning that it is a pre-defined list of values that doesn’t change that the user is able to select from.

Visual Report Designer - Parameter Collection Editor - Look-up Values

Next, we’ll need to set up some calculated fields as the parcel fields will not work for our purposes without modification, and we’ll need to create special fields for implementing the grouping feature.

Visual Report Designer - Calculated Fields Editor

The two ‘area’ fields are similar in implementation. The only difference is in the conversion factors. The way these work is to first convert the area from ‘square drawing distance units’ (i.e. either ‘ft’ or ‘m’) to square meters to ‘normalize’ the data to a known unit. This is accomplished using the function _ToMetricDistanceConversionFactor(), which is called twice (i.e. the value is ‘squared’) to effectively get a ‘to metric area conversion factor’. Once the value is known to be in square meters, we can then multiply by the correct conversion factor to convert it to acres or hectares, or whatever else we desire.

Visual Report Designer - Expression Editor

The GroupByValue calculated field will be used to determine the value that will be used for grouping the parcels when generating the report. Because we are offering the user a choice we cannot just directly reference a specific field…instead we create an expression which checks the user’s choice, and conditionally retrieves the value of the field associated with that choice.

Visual Report Designer - Expression Editor

Note that if you only want to group by one particular field instead of allowing the user a choice, this (and the GroupByHeader calculated field can be omitted from the report, as can all of the other steps related to these items). Also, if ‘None’ is selected by the user, the default value (basically, an empty string/text value) in the last line of the expression will be returned.

The GroupByHeader calculated field is similar to the GroupByValue calculated field except that instead of extracting a value from an actual parcel field, we just return a text value with the name of the field:

Visual Report Designer - Expression Editor - nested conditional expression returning plain text

Now that we have all of our parameters and calculated fields set up, we can create the report template. To do that, we do the following:

  1. Drag and drop the Title parameter from the field list into the report header; adjust title label size, font, etc.
  2. Add a Detail Report band bound to the ‘Parcels’ entity collection to the default detail band. In here we add 3 fields to the child detail band (Detail 1) by dragging from the field list: Name, and the 2 ‘Area’ expressions we previously defined. We also adjust label size, alignment, and font as needed.
  3. The precision of the ‘area’ labels can be set using a ‘format string’ via the label task pane:
    Visual Report Designer - Argumented Label Tasks - Format String
  4. With the detail band Detail 1 selected, we add a group and a child sort operation. The group operation should key on the calculated field GroupByValue and the option to show the header should be enabled. The sort operation should use the parcel Name field – this will sort the entities within each group by Name. Both operations should use the Ascending sort order option.Visual Report Designer - Group and Sort - Parcels
  5. Next, we add the column headers to the GroupHeader band created in the previous step. The Name and ‘Area’ column headers are simply labels with static text and are created by inserting labels from the Tool Box; the two in the center which contain the group information are data-bound labels which show the values returned by the GroupByHeader and GroupByValue calculated fields. These last two are created by dragging the calculated fields from the field list and dropping into the appropriate location in the report template. Of course, font, alignment, and label size should be adjusted as needed for consistency with the rest of the report template.
  6. After setting up the main body of the table, we still must add the summation function. To do that we drag and drop the two ‘Area’ calculated fields into the report footer to create data-bound labels, and then align to the appropriate columns in the main table/report body. We then use the task pane to configure a ‘summation’ operation for these labels (see below). Once that is done, we can add the plain text label containing the header ‘TOTAL’, and can configure alignment, font, precision/numeric formatting etc.
    Visual Report Designer - Argumented Label Tasks - Summation
  7. Add horizontal and vertical lines and/or cross-band lines to complete the table formatting.

The end result looks like this:

Visual Report Designer - Report Template

You may notice that this report also includes an empty image control that we have yet to mention…you can easily add an image from the Tool Box and bind it to a file containing your company logo, etc if you like.  It can just as easily be omitted.

From here we can ‘preview’ the report and test the features we implemented. Be sure to save first.

When you click on the Print Preview tab, Visual Report Designer will initiate a report preview process. You will first be shown the Query Editor window where you may choose which entities to run the report on, and may modify the report parameters:

Visual Report Designer - Edit Queries - Root Queries Tab

Visual Report Designer - Edit Queries - Report Parameters Tab

For the example here, we’ll edit the GroupBy parameter value to have the report group the entities by the SiteName field, and we’ll leave the query and selection set settings alone so the report will automatically pick up ALL parcels in the current DWG. Once this is set, we click on the OK button to generate the report preview document:

parcel area table document preview

As previously mentioned, it is possible to do quite a bit more with this report. For example, we might want to add a group subtotal summation. Through scripting we can even make a conditional group subtotal summation that only appears if more than one parcel is in a group, but again, we’ll save this for a future post.

Posted on

Calculating Storage Basin Volumes with Terra Power Tools

Calculating Storage Basin Volumes with Terra Power Tools

Terra Power Tools includes a feature for floodplain analysis which can be used to calculate the volume of water stored in a basin if the water surface elevation is known, and conversely can calculate the elevation of the water surface if the volume is known. Let’s take a look at the following model:

Grading surface in AutoCAD Civil 3D

This is an arbitrary basin created using the AutoCAD Civil 3D ‘Grading-4.dwg’ tutorial dataset as a starting point. It has been modified by first leveling the feature line to z=765.0’, then by adding an interior slope at -2:1 to a distance of 25’, and finally an infill was added. We also created a copy of the feature line, and exploded it to form a closed 3d polyline that will be used later.

In Terra Power Tools, we first import the surfaces and then adjust the display style and color of the EG surface so we can clearly see our grading surface. Next, we import the polyline as a boundary – this will be used to limit our calculations to the interior of the basin.

Grading surface in Terra Power Tools

From here, we use the ‘Floodplain’ command in Terra Power Tools to bring up the Floodplain Volume Result Editor window:

Floodplain Volume Result window

In order to limit the calculation to the interior of the basin (vs the extents of the surfaces), we select the option for a ‘bounded’ volume computation and select the boundary:

Select Boundary

We also need to set the surface used for the computation to the grading surface:

Select Surface

We can now use the Floodplain Elevation panel to set an elevation for which we want to calculate a volume and watch the model and the calculation results update in real time:

Initial floodplain analysis calculation results

The results of the volume calculation are shown in the Results panel (the result we are after here is the ‘flooded’ volume, which is above the referenced surface and below the water elevation; the ‘not flooded’ volume is below the surface and above the water – this is typically not used):

floodplain volumes

The process is simple, fast, accurate and reliable. It also does not require the creation of special surfaces in your drawing – the water surface exists only virtually, so your drawing remains uncluttered.

If instead you know the volume you want to store, and need to simply calculate the elevation of the water surface given that volume, the process is just as simple. Instead of modifying the elevation of the floodplain using the elevation field or the slider, you can use the ‘Targeted Volumes’ subpanel to specify the target volume and a tolerance:

Targeted Volumes

Once set, click on the ‘Compute Elevation’ button and the results in the panel will be almost instantaneously updated with an elevation calculated to yield the targeted volume within the specified tolerance, and the results panel will be updated with the final ‘actual’ calculated volumes:

Targeted volumes - results

The 3d model in the graphics viewport will also be updated to reflect the final values calculated above:

3d visualization of the grading surface plus the calculated floodplain surface

For more information on Terra Power Tools , or to request a trial license, please contact us .

Posted on

Surface Blending in AutoCAD Civil 3D

Surface ‘Blending’ in AutoCAD Civil 3D

Surface Stitcher - Blended Surface

Out of the box, AutoCAD Civil 3D supports a technique called ‘pasting’ for combining data from multiple surfaces to form a composited ‘finish grade’ surface. The paste technique is basically a cut-and-replace process – the boundary of the surface being added is used to clip data out of the receiving surface, and then the resulting void is filled with the added data. Retriangulation then occurs using the remaining points and breaklines from the original surface combined with the pasted points and breaklines.

If there is any disjoint between the surfaces which are being combined, the resulting triangulation can sometimes be quite ugly where the new and the old data meet. To illustrate this, let’s look at an example where we are pasting a corridor surface into an existing ground surface to create a finished grade surface. At corridor stations, we expect the surfaces to meet up nicely, but what happens in between? Typically something similar to this:

Corridor surface doesn't tie into existing ground between corridor stations

Because the corridor surface comprises a series of straight lines between points at specific, usually regular stations, and because the existing ground surface is typically randomly populated with points, it is almost certain that the two surfaces will not meet precisely along the boundary except at corridor stations. In between, there will be a gap or overlap as shown above. If you consider how this might triangulate in a 3d surface model, it becomes quite apparent that the results can easily be less than satisfactory.

triangulation at the intersection of existing ground and a corridor surface

Where a data point exists on the existing ground surface near the boundary of the pasted surface, but in between the data points of the pasted surface, a poorly formed triangle with a steep slope will be created. If the data points on the existing ground surface are farther away from the pasted data, this effect becomes mitigated and the triangles become closer to being considered ‘well-formed’.

When this situation occurs, common practice is to ‘offset’ the clipping boundary to make it larger, thus preventing any data points from being ‘close’ to the actual edge of the pasted surface data. This often produces acceptable results as long as there is not too much variation in the data. Even then, it is still possible to see some undesirable triangulation in the transition area between the existing and new surface data.

Another situation where a similar issue might occur is when you have two separately imported/surveyed surfaces that must be combined to for a single existing ground surface. If there is a gap between the surfaces, or the surfaces don’t agree perfectly where they meet, you will run into the same sort of problem as described for the corridor surfaces above.

In either example, the worse the ‘agreement’ between the two surfaces, the more exaggerated this problem will become, and the larger the transition zone must be in order to achieve anything resembling acceptable triangulation. This comes with its own pitfalls.  By enlarging the transition zone, you are removing data from a surface and replacing it with a straight-line transition:

without blending, surfaces are joined with a straight line

Intuitively, you can see in this diagram that a straight line is not a realistic approximation of what an actual surface would look like. This got us thinking…what if it were possible to ‘blend’ the two surfaces together in such a way as to fill the gap in the transition zone with a curve that is proportionately influenced by the adjacent surfaces (the closer to a given surface, the more influence that surface will have on the shape of the curve).

blending causes surfaces to be joined with a curve to better approximate the transition

Thus was born the new application we call Surface Stitcher.

(Please note that Surface Stitcher is still in a prototype phase, but is currently available for preview/beta testing…please contact us for details).

To illustrate what this new application does, we have a pair of surfaces as shown below (to see a paste-and-blend operation similar in nature to the corridor surface scenario described above, please refer to our previous post, Surface Smart Paste Operation ):

two surfaces to be joined

Of course we would expect a closer agreement between the boundaries of these surfaces in a ‘real’ project; this particular dataset is intentionally a ‘worst-case scenario’ model we use for testing. It contains a large degree of variation along the edges of the transition zone between the surfaces, voids which penetrate into the surfaces along these edges, etc.

To combine these surfaces, we simply run the Surface Stitcher command to ‘Join Surfaces’ (inside of AutoCAD Civil 3D), select our surfaces, and press the ‘OK’ button:

join surfaces dialog

The result is a new surface containing all of the two source surfaces, plus a ‘blended’ transition zone (the new surface is shown here as ‘background’ contours):

blended surface superimposed as 'background contours' against two source surfaces

Note that it is also possible with this command to join the surfaces without blending. We’ve created such a surface as a comparison and have imported both variants of the ‘joined’ surface into Terra Power Tools to make visualization and comparison easier (the ‘blended’ variant is shown in blue and the ‘unblended’ variant in brown):

Terra Power Tools used to visualize blended and unblended surfaces as 3d contours

From the 3d display of the surfaces as contours, it is easy to see that the ‘unblended’ surface is far more jagged and angular in the transition zone. If we zoom in a little tighter, it becomes even easier to see the difference:

Terra Power Tools used to visualize blended and unblended surfaces as 3d contours - zoomed in

…and, if we play around with the visualization settings a bit, the blended surface model looks quite good, especially considering how poorly matched the two source surface models were:

blended surface rendered with smooth elevation banding with contours superimposed

For more information about Surface Stitcher, surface blending, Smart Paste, Terra Power Tools, or to request to join our beta testing program for Surface Stitcher, please contact us .

The web store has been temporarily placed in demo/test mode while we update and test some new features. If you see this message and wish to make a purchase please contact Thank you.