Terrain Relief Models, Unabridged

CAM Workflow: PixelCNC

PixelCNC is an inexpensive but powerful program for processing images (and STL files) into toolpaths. When you first install, be sure to go to CNC/CAM Settings under the Config menu and select your Post-Processor (e.g. GRBL (Metric).txt) and your preference for Units of Measure (e.g. Millimeters). The Heightmap Export plugin uses millimeters, and using the same units throughout is quite nice. While you’re in there, you can also twiddle with Toolpath Simplify and the other options if you so desire.

When you create a new project in PixelCNC, you will step through the icons on the left one after the next. Start with Project Setup (the landscape photo) to load your heightmap and set model parameters, continue on to Cutting Tools (the wrench/spanner) to define your carbide, move along to Project Operations (the graph) to create your toolpaths, and then enjoy the CNC Simulation (the film frame). Once you’ve stepped through the project icons one after the next, you return to the File menu to export your G-code (and save your project)… and then take a quick detour through a text editor to split the G-code file by tool. So, on to the detailed steps…

Project Setup (first icon)

  1. Click Load Image and load your heightmap PNG.
  2. Click Input Size/Origin to show the Input Dimensions section on the top right of the screen.
  3. In the X-Width box, enter your model width on the X axis.
    • In the .ini file from Heightmap Export, the value named x_width in the [Model] section is the width in millimeters.
  4. In the Z-Depth box, enter your model’s depth in the Z axis.
    • In the .ini file from Heightmap Export, the value named z_depth in the [Model] section is the to-scale depth in millimeters. To compress or exaggerate the model’s Z axis, just scale it as desired.
  5. Set your origin.

    For terrain relief model carves, I have found I prefer to use top of stock and centered as my origin (50% for X-Offset and Y-Offset, and 100% for Z-Offset). PathTracer assumes Z-zero is stock top, so if you’re going to use it to engrave trails onto a terrain model, keep Z-Offset set to 100%.

  6. Click Apply.
  7. If you’d like, you can add a Smooth Radius by clicking Input Properties and entering it on the right.

Cutting Tools (wrench icon)

  1. Click a tool slot (e.g. [01] none) to open its entry on the top right.
  2. Give the tool a Name.
  3. Choose the Type.
    • Cylinder – Flat and ball nose endmills.
      • Flat: Set Corner Radius to zero.
      • Ball: Set Corner Radius to half the diameter. (Just type in any too-large value and it’ll conveniently round down to half the diameter.)
    • Tapered – Tapered endmills.
      • Set the Tip Diameter (not radius), Taper Angle, and Flute Length. The calculated shank diameter shown in the graphic should match the actual diameter. If it doesn’t, double check your numbers.
    • V-Bit – V-bits, of course.
  4. Click Apply.
  5. Continue from step one for each additional tool.

    At least as of PixelCNC version 1.33a, you cannot yet save tools. This is annoying, but the rest of the process works so well, que sera.

Project Operations (graph icon)

  1. Click New Operation to open a new entry on the top right.
  2. Give the operation a Name.
  3. Choose the Op.

    I like Horizontal (basically “waterline” style) for roughing and Parallel (straight in X/Y while terrain-following in Z) at a 45° angle for finishing. Generating toolpaths is so fast and the simulation so easy, experimentation is certainly encouraged.

  4. Choose your Tool and settings.

    I do have my personal settings, which might be not dangerously bad for southern yellow pine dimensional lumber on a Shapeoko with a quarter-inch ball and a 0.5mm-radius tapered mill, but I’ll just call machining settings beyond the scope of this writeup… except to say that you probably do want to check Rest-Machining, one way or another.

  5. Click Apply. Toolpaths will generate.
  6. If you’re doing multiple operations (e.g. roughing, then finishing), which you obviously are, continue from step one for each additional operation.

CNC Simulation (film frame icon)

  1. Just play around with it, especially at very high speeds. :grin:

Exporting and manually splitting your G-code

  1. Click the File menu, then click Export G-Code.
  2. Save the .nc file.

    PixelCNC also does not split files by tool, so we’ll do that manually. Another annoyance, but everyone should get at least a little comfy with G-code, really.

  3. Open the .nc file in Notepad++ (or the text editor of your choice).
  4. Each operation begins with a ( Tool: 1 ) (or 2, 3, et cetera) comment line. Cut and paste the header, i.e. everything above that first ( Tool: 1 ), somewhere convenient.
  5. Find (e.g. Ctrl-F) the next line starting with ( Tool:

    If you don’t find a second line, you’re on the last tool, so just select all.

  6. Copy your saved header, plus everything above that second ( Tool: line, into a new file for that tool.

    For completeness, you can add a line with just M30, i.e. “End Program” in G-code, at the bottom of each file.

  7. Repeat from step 5 until you reach the end of the combined file PixelCNC exported.
1 Like