I’ve been playing with some ideas, code and Carlson Civil Suite today and I’ve stumbled across an interesting issue with Carlson’s contour routine.

Given this equation for a hyperbolic paraboloid, For more information on this surface

 

And porting some code to VBA so everyone can follow along

Option Explicit
Public Sub Parabolid()
Dim x As Double
Dim y As Double
Dim z As Double
Dim a As Double
Dim b As Double
Dim pt As AcadPoint
Dim coords(2) As Double
Dim result As Double
a = 1
b = 1

For x = -10 To 10 Step 0.1
    For y = -10 To 10 Step 0.1

        z = x ^ 2 / a ^ 2 - y ^ 2 / b ^ 2

        coords(0) = x: coords(1) = y: coords(2) = z
        ThisDrawing.ModelSpace.AddPoint (coords)

    Next y
Next x

End Sub

 

And then triangulating and contouring with these options

 

 

Produces a couple of visible errors

 

 

 

After a trial run with the “Reduce Vertices” option turned off the results appear correct, or at least visually correct, I’ve not verified them.

 

 

 

So I’m left wondering why the reduce vertices option produced asymmetrical results.

How many times have you pieced together the spot elevation data on a set of plans, triangulated it and then contoured it only to find isolated areas where the triangulation routine did not quite get it right? I sometimes contour at ridiculous contour intervals searching for any small anomalies that won’t show up on a one or two foot interval but will show up in your parking lot while grading. So I like preparing DTMs and then contouring at an interval of 0.10 or 0.25 feet. This gives me the ability to pick out any hiccups that have resulted in the triangulation routine. Then I can use Carlson’s Surface Manager to manually add or delete any points, to swap edges or to even delete triangles. I was a bit shocked that this excellent tool wasn’t mentioned in any of the sessions that I attend at the recent Carlson User Conference. It works like this:

Once you have a tin file, you start the Surface Manager like this

 

 

Or you can click the corresponding icon on the Carlson Surface tool bar, either of which will yield

 

From here you first, Add a surface then highlight it and press Set Current. You may use the Properties button to launch a modified Triangulate and Contour dialog to setup how your surface will be treated on the screen. Pay special attention to the “Draw Slope Arrows” option, it can be a lot of help.

Now using these menu options, Add Point, Remove Point, Remove Triangle, Set Point Elevation, Swap TIN Edge and Add Breakline, you can tweak away at your tin, dynamically!

 

There isn’t a toolbar provided for these options but one is easily enough made, and if you pay attention to the command line you can pick-up a few other neat tricks.

 

 

 

Seems I have gotten ahead of myself, I have started posting about things like DTMs and TINs and I have not attempted to explain what they are. For starters, a DTM is a Digital Terrain Model and a TIN is a Triangulated Irregular Network. For the most part, I often use the terms interchangeably but there is a minute difference. Both terms represent a surface, a composition of plane segments that represent and model the shape of the earth. Both compositions contain points, connected by line segments, line segments that define edges of triangles. Adjoining triangles share both vertices and edges; the vertex of one triangle cannot lie in the interior of another triangle.

The difference lies in the orientation of the points; a DTM is most often affiliated with designed surfaces while a TIN is often associated with field collected data, hence the irregular-ness.

Occasionally I encounter a set of grading plans with nothing but contour lines as a guide to building a site. Seldom, if ever, does contour lines provide sufficient data to properly establish an accurate DTM from which to work. Allow me a chance to illustrate:
none
Looks simple and straightforward does it not, put a little more thought into it. A section from a not so arbitrary, direction wise anyway, baseline yields this section :
none

none
What are the odds that the design engineer actually intended to break the –2% slope to –2.8%? Or is it more likely that the -2% was intended to strike the 2:1 slope? In this example the later is the true statement.  Then why does it show the change in grade? Simple, the contour interval is set at 1-foot, so with a 2% slope there are only two contour lines generated every one hundred feet. Anything that happens inside this interval is not propery represented by contour lines. Just one example why the design engineer should always include alignments and typical sections.