Wooden Topographical Map

Instructions on how to generate the files required to laser cut a wooden topographical map, complete with streets, train lines, water features, and whatever else may be of interest.


Project maintained by ARamsey118 Hosted on GitHub Pages — Theme by mattgraham

Get QGIS Set Up

Side note: Most of these can be done from the GUI, but I prefer keyboard shortcuts so that’s what the instructions will favor.

  1. Open up QGIS and create a new project (Ctrl-N). This will provide a workspace to import all the files. Hit Ctrl-S to save it somewhere safe.
  2. Ctrl-L opens up the Data Source Manager. This tool imports the previously downloaded files into QGIS.
    1. Add any shapefiles as vector files (usually ending in .shp). Note that if the shapefiles are from the Census Bureau, they have a bunch of metadata that can be safely ignored, the .shp files is the only one that needs to be imported. The default settings work fine.
    2. Add the DEM as a raster file. Again, defaults are fine here.
  3. If all went well, it should look similar to this qgis_initial_import

As a quick aside, the files will be rendered from bottom to top, with the newer ones drawing over the older ones. Click and drag to rearrange, or use the checkbox to hide layers temporarily.

Making Contours

We’re ready to make some contours. This is where things start to get subjective, so feel free to do what looks best, these are my suggestions.

Stitching Files (Optional)

If the desired region spans more than one DEM file, the layers can be merged together with the Merge tool, under “Raster -> Miscellaneous -> Merge…”. Select the input layers with the three dots on the right side of the “Input Layers” box and then press “Run”.

Note that this creates a temporary or scratch layer (denoted by the small computer memory chip temp_layers), which are not saved and will be lost if the project is closed. If desired, save these layers by right clicking on it and then selecting “Make permanent”.

Smoothing Out The Surface

Skipping straight to contour generation produced some very jagged edges, and the contour lines will eventually end up as the cut lines for the wood, so some smoothing may be desired. Since this will involve filtering, it’s useful to have a little data on the edges that can be thrown away to avoid the filter startup effects. If the map size is too large and the following steps are slow, feel free to skip to Trimming To Size and use a slightly larger area than the final size.

  1. In the “Processing Toolbox” on the right side, under “GRASS”, select r.neighbors as shown: filter_setup (As a brief aside, this does not appear to be how the professionals do it. See “A design of contour generation for topographic maps with adaptive DEM smoothing” 1 for more information).
  2. Choose a number of neighbors and click “Run”. More neighbors will result in more smoothing and a longer runtime. A few notes:
    1. If none of the neighborhood operations perform the desired function, it’s possible to use a custom filter.
    2. It should be possible to speed up this filtering operation, especially for large neighborhoods, using something akin to fftconvolve, but I have yet to find a way to do it without some additional plugins. If you find something better, please open an issue in the repo!

Contour Generation

The contour generation process has one main consideration, contour spacing. This influences the number of contours, and therefore the number of wooden layers (which in turn, sets the thickness of the map).

  1. The Yosemite map elevations run from 478 to 3,440. layers_elevation

    This data is in meters, but different datasets may follow different conventions and use different datums.

  2. For this example, let’s say that the map should have about eight layers. That would translate to $\frac{3440-478}{8} = 370.25$. This can either be left as is, or rounded as desired. The following examples use 400m contour lines.
  3. Select Raster -> Extraction -> Contour…, then pick the desired layer (likely called “neighbors” from the neighbor filter that ran). Enter the contour spacing as “Interval between contour lines”.
    1. (Optional) If the contours should be offset (e.g. 200, 600, 1000) instead of starting at zero (e.g. 400, 800, 1200), enter the offset in “Offset from zero relative…”.
    2. (Possibly Required) My version of QGIS has a bug where contours won’t save properly to temporary files and have to be written to disk. This can be done by selecting a file towards the bottom of the window (Scroll down to find “Contours” “Save to a temporary file”).
  4. Press Run

Here’s the contours I got after my first run with 101 neighbors:

neighbors_101

I decided some more smoothing would be good, so I went back re-did the filtering with 201 neighbors:

neighbors_201

This is very much a matter of personal opinion so a few iterations may be necessary to find something that looks good.

There may be a few contour lines which are too short to add any real value and would be annoying to assemble. To remove them

  1. (I’ll copy the instructions over later so this guide is standalone, but for now the instructions at https://theshamblog.com/making-a-laser-cut-topo-map-the-design-phase/, step 3)

Feature Preparation

Trimming To Size

It’s fairly easy to trim, or in QGIS terminology clip, the map to size using a vector outline of the desired shape/size.

Create A Vector

There are several methods for generating the vector outline, here’s two:

Double click a layer and pick “Symbology” to change how it is displayed on the map. For layers such as the clipping vector, it’s helpful to decrease the opacity so the other layers can be seen simultaneously.

There’s a “Scale Feature” tool that is handy for creating a slightly larger outline to help with Smoothing Out The Surface.

Trim The Map

Each layer will have to be trimmed.

Only the vectors (contours, streets, etc.) will actually be exported, so trimming rasters is optional.

  1. Select Rasters->Extraction->Clip Raster By Mask Layer… The raster will be the Input Layer and the newly created vector will be the Mask Layer.
  2. (Optional) Scroll down to save it to a file.
  3. Hit Run.

For vectors, the process is similar, but the tool is located under Vector->Geoprocessing Tools-> Clip…. The Input Layer will be clipped and the Overlay layer will be the new border.

Here’s the map after this step is completed, with the map extent in light blue shading, contours in dark blue lines, and roads in brown lines.

clipped

Dividing Features By Contour Line

Since each contour is the boundary of a different piece of wood, the features (roads, waterways, etc) need to be divided up such that they can be etched individually onto the wood.

  1. Convert the map extent polygon to lines using Vector->Geometry Tools->Polygons to Lines…
  2. Merge the newly clipped contour lines and freshly created map outline using Vector->Data Management Tools->Merge Vector Layers… Click the three dots next to the “Input Layers” box to select the two layers
  3. Translate the merged line layer back to polygons using “Vector Geometry->Polygonize” from the Processing Toolbox. polygonize If the output is missing some polygons, there’s probably a misalignment between the extent lines and the contour lines, which can happen if the contour lines were generated from a raster that was (almost) the same size as the extent, instead of being clipped down to size.
  4. Using the same Clip tool as before, select the feature layer as the “Input Layer” and the new polygons as the “Overlay layer”. Click the green arrows iterate to iterate over the polygon layer one polygon (i.e. contour or wood piece) at a time. The result will be a lot of layers, so it’s useful to save to a file instead of creating temporary layers. roads_split Note how the roads change color as they cross the contour lines, indicating that they’re now separate layers.

Repeat for each feature.

Exporting

Under construction

Area Estimation

Under construction, but here’s some links to get started