Terrain Relief Models, Unabridged

CAM Workflow: PathTracer (for adding engraving trails)

The Heightmap Export plugin for QGIS also includes an additional… sub-plugin?.. called PathTracer. By simply feeding it a PNG heightmap, an SVG of paths to engrave, and some dimensions, PathTracer will generate a G-code file mapping the paths from the SVG onto the surface of the heightmap. You can then engrave the path G-code file onto the terrain model using a sharp engraving bit or (my personal favorite) a laser.

  1. Open QGIS.
  2. From the Raster menu, go down to Heightmap Export and choose Heightmap Export.
  3. Click the Start PathTracer button at the bottom of the Heightmap Export dialog to launch PathTracer.
  4. Click the Browse button to the right of the Heightmap box and open your PNG heightmap (which will take a moment).

    If the .ini file that Heightmap Export plugin saved is there with the PNG, the dimensions in it will be read into PathTracer automatically.

  5. Click the Browse button to the right of the Pathmap box and open your SVG pathmap, i.e. the nice properly-scaled SVG you saved after going all Inkscape on the QGIS-exported DXF.
  6. If you need to adjust the dimensions (e.g. because you’ve scaled your terrain model), adjusting X or Y will change all three to scale.

    If you exaggerated or compressed the depth when doing the terrain model CAM, adjust the Z here to match. You can change it independently of X/Y.

  7. Set your X Zero (%) and Y Zero (%) (in the same manner as PixelCNC does). Z-zero is assumed to be top-of-stock.
  8. Set a safe Retract Z height (in millimeters).
  9. Set your plunge and feed rates (in mm/min).
  10. The Optimize box allows for rudimentary optimization of the resulting toolpaths. Include a small value (in millimeters), and basically, if a point in the generated path is closer than that to the line between its neighbors, it’s pruned.

    There can be a large difference in lines of G-code with a small value, e.g. 0.1mm, but if you use a non-zero value, do pull your output into a simulator and see how you like it before you start running the job in the real world.

  11. Rescale heightmap to full range and save new PNG. is an experimental addition that should currently be left unchecked unless you know what you’re doing.

    I wrote it, and I haven’t even had a chance to play around with it enough to make sure it does what its supposed to do. :sweat_smile:

  12. If you’re going to be using a laser to engrave the trails, check the Enable Laser Mode box.
    • In laser mode, Initial Plunge is irrelevant and ignored.
    • Power % is the PWM percent of laser power to use.
    • $30 = is your GRBL parameter $30 (maximum spindle speed) value for 100% laser power.
    • $31 = is your GRBL parameter $31 (minimum spindle speed) value for 0% laser power.
  13. If you want to apply a fixed offset to the values in the generated G-code, check Enable Offsets and enter values in millimeters.

    If you have a fixed laser offset a certain distance from the spindle axis, you could use this option rather than using alternate Work Coordinate Systems or rezeroing, or at least that was the intention. If nothing else, it makes the dialog look nicely balanced, so I don’t believe I have any reason to remove it. :grin:

  14. Click the Export G-Code button and save your results.
  15. Please do at least glance at the resulting G-code in something like the NC Viewer web site (no install required) before using, just to catch any really obvious issues. (And if you do run into any, bug reports are a cause almost as worthy as a nice mutton, lettuce, and tomato sandwich.)
1 Like