Working with terrain models

GiD - The personal pre and post processor

Working with terrain models

A terrain model is a particular kind of geometry that usually is considered as z(x,y), that is, each projected point (x,y) has single value of z. Note that this kind of model is not able to represent vertical planes, nor overlapped entities in z direction.

Common ways to describe a topography are:

a) A collection of level curves (iso-lines with same value of z)

b) A cloud of irregular x,y,z points

c) A collection of triangles or TIN (triangulated irregular network)

d) The height z(x,y) on a regular grid of quadrilaterals

e) Other, like standard CAD files, using generic surfaces

In this course, we will explore how to deal with this kind of models following some of these approaches.

Level curves

Ensure the default values of  'Automatic collapse' and 'automatic tolerance values' are set in the 'Import and Export' branch of preferences window, and import the file named 'level_curves.dxf' using 

Files->Import->DXF...

The result is a model with a collection of straight lines like this:

After importing the file, we recommend to save the model, so as we can access always to the GiD model with the file already imported.

Creating separated surfaces

It is a model of lines, not of surfaces. Some lines could be used to build surfaces, but it should be a hard task.

To facilitate the work the 'near tangent' lines (with a tolerance) could be joined to reduce the number of curves of the model. To do so, use 

Geometry->Edit->Join->Lines,

and select all of them. The result should look like the following figure.

To create surfaces it is needed to have a set of closed contour lines. It is possible to create extra curves to enclose regions of topologically four curves, to create surfaces defined 'from its boundary'.

Use

Geometry->Create->Line 

and pick two existing points, for example create these two new lines:

In some parts, there may be needed some extra point to create the desired line, it is possible to force the division of a curve 'close to a coordinate' using 

Geometry->Edit->Divide->Lines->near point

Select the existing point A, press <ESC> and then the line/s to be divided

Then, it is possible to use the new created point to create a new line:

Note: when selecting the 'near point' it is possible to click the right-mouse button to open the contextual menu, and select other options, like 'Point in line' to pick a point over a curve, like the one to be divided.

Now we can create a new surface interpolating its boundary curves:

Geometry->Create->NURBS surface->By contour

And select the boundary curves.

With this procedure, we can create the three surfaces of the image. The surfaces will have only C0 continuity between them (normals between them are discontinuous), but the shape could be good enough to generate a surface mesh valid for some simulations (see the mesh of the image above).

Creating surface from a family of parallel curves

Another way of create surfaces based on level curves is from a collection of 'near parallel curves'. The surface created will interpolate the curves and will have continuity in normals inside it.

For example, we can divide some curve if necessary and send the curves of the image to another layer to facilitate the selection, 

We are going to smooth a little bit the shape of the curves. Prior curves must be converted to NURBS expression.

Geometry->Edit->Convert to NURBS->Line

And then modify a little its shape forcing the tangency at joining points.

Geometry->Edit->Lines operations->Force to be tangent

And set a very big tolerance angle (between tangents), like 90 degrees

Then lines can be joined using

Geometry->Edit->Join→Lines

At this point we already have the family of 'parallel' smooth curves to be used for the creation of the interpolating surface:

Geometry->Create->NURBS surface->Parallel lines

As can be seen this may be a manual and tedious procedure to re-build a surfaces model depending on the complexity of it, but in some cases this procedure may be very useful to simplify large models.

Cloud of irregular points

An interesting option is to create a single NURBS surface approximating (not interpolating) a cloud of points. It creates a rectangular shape projecting in a direction (in this case, z direction). To do so, use

Geometry->Create->NURBS surface->By points

and select all the points of the model

Note: surface sides are not parallel to XY axis, because other automatic 'main directions' are calculated

We can then use only part of the whole surface, trimming it. For instance, if we want only the rectangular region between the corners (156,1352) and (1178,128)

We can create a rectangle

Geometry->Create->Object->Rectangle

156,1352,0
1178,128,0

Then extrude it to create lateral surface that intersect with the terrain

Utilities->Copy...  (Lines, Translation, increment z=300, Do extrude: Surfaces)

Now, for intersecting the surfaces use

Geometry->Edit->Intersection->Surfaces

And select the surfaces

Then you can delete unwanted parts

This allow for example to create a 3D volume box for CFD simulations of the air around the topography.

TIN from points

A simple way to sample points is creating a mesh, and exporting the coordinates of the nodes as a simple text file. Create a new GiD project using

COPYRIGHT © 2026 · GID · CIMNE