Creating a 3D Printed Digital Elevation Model in QGIS

Creating a 3D printed digital elevation model can be achieved using QGIS and the DEMto3D plugin. This tutorial demonstrates the creation of a 3D STL file that can be printed using a 3D printer.

This example uses digital elevation data obtained from the Lle Geo-Portal that covers nearly all of the area of Wales, United Kingdom.

Software used:

  • QGIS Version 3.6.3-Noosa (https://qgis.org/en/site/forusers/download.html)
  • DEMto3D (https://plugins.qgis.org/plugins/DEMto3D/)
Data:
  •  Lle Geo-Portal (http://lle.gov.wales/GridProducts#data=LidarCompositeDataset)
Screenshot of the Lle Geo-Portal website.
Screenshot of the Lle Geo-Portal website.

Elevation data at 1 metre resolution has been obtained from the Lle Geo-Portal for this tutorial. A total of four grid squares have been downloaded and the area of interest will be refined using QGIS in a later step. The image below shows the four grid squares chosen.

The grid squares chosen to download were:

  • LiDAR Composite Dataset – DTM – 1m – ASC – SH55
  • LiDAR Composite Dataset – DTM – 1m – ASC – SH65
  • LiDAR Composite Dataset – DTM – 1m – ASC – SH64
  • LiDAR Composite Dataset – DTM – 1m – ASC – SH54
Image displaying the grid squares chosen for the tutorial.
Image displaying the grid squares chosen for the tutorial.

After creating a new project in QGIS, import the elevation data using the Layer -> Add Layer -> Add Raster Layer menu option. The data is downloaded in the ZIP file format containing multiple ASC files that can be imported directly into QGIS. ASC files essentially contains lists of cell values, which in this case are elevation values in metres.

Due to the number of individual files and for ease of visualisation, each of the individual files will be merged to create a raster mosaic. The contents of each ZIP file be merged initially, then finally the four resulting rasters will be merged together to form a single raster mosaic.

Data downloaded from the Lle Geo-Portal is projected in OSGB 1936 / British National Grid and this projection should be selected in the project properties, as shown below.

 

Screenshot showing the QGIS project projection properties.
Screenshot showing the QGIS project projection properties.

Using the GDAL -> Raster Miscellaneous -> Merge tool available in the Processing Toolbox, merge the individual rasters to create a single raster.

The next step is optional and is used to visualise the elevation. Duplicate the elevation layer and set the layer symbology to Hillshade on the first layer, as shown in the image below. On the second layer, set the layer symbology to Singleband Psuedocolor, making sure to set the Blending Mode to Multiply in the Color Rendering options panel.

Screenshot showing hillshade symbology properties.
Screenshot showing hillshade symbology properties.
Screenshot showing singleband pseudocolor symbology panel.
Screenshot showing singleband pseudocolor symbology panel.

Once the symbology has been applied, the digital elevation layers should appear as below.

Screenshot showing digital elevation layers with symbology applied.
Screenshot showing digital elevation layers with symbology applied.

The next step is clip the area of interest from the raster, ensuring there are no gaps contained within the elevation data as this would cause issues with creating the STL in later steps.

Using the GDAL -> Raster Extraction -> Clip Raster by Extent tool in the Processing Toolbox to clip an area of interest as shown in the screen of the ‘Clip Raster by Extent’ dialog box shown below.

Screenshot of the Clip Raster by Extent dialog.
Screenshot of the Clip Raster by Extent dialog.
Screenshot showing the clipped elevation layer.
Screenshot showing the clipped elevation layer.

The resulting clipped layer is visualised in 3D within the 3D Map View in the screenshot below, using the settings shown in the screenshot of the 3D Configuration settings.

Visualisation of the digital elevation data in 3D.
Visualisation of the digital elevation data in 3D.
Screenshot of the 3D configuration settings.
Screenshot of the 3D configuration settings.

Once an area of interest has been clipped from the full raster containing the elevation data, open a 3D map view from the View -> New 3D Map View menu selection.

Isolate the clipped layer and set the terrain elevation in the 3D Map view settings dialog to the clipped extent.

Finally, create the 3D printable STL file using the DEMto3D QGIS plugin, available from the Raster -> DEMto3D -> DEM 3D printing menu option.

Using the options shown in the DEMto3D settings dialog below, configure the properties of the resulting STL file according to your desired printing properties including final printed model dimensions.

Screenshot of the DEMto3D settings dialog.
Screenshot of the DEMto3D settings dialog.

Once the desired properties have been chosen, simply click ‘Export to STL’ to create an STL suitable for printing.

Finally, results can be visualised in your favourite 3D printing software or alternatively loaded in CloudCompare for quick visualisation and to check the quality of the STL file output.

Visualisation of the final STL file using CloudCompare.
Visualisation of the final STL file using CloudCompare.

Leave a Comment