Introduction: CNC Cut Map With Photo Engraving
This Christmas I didn't know what to give my father, as he didn't really needed anything. However, since the FabLab where I volunteer recently had moved to a bigger space, it has become much easier accessing the CNC equipment. On top of that, one of my friends have donated all his off cuts from his floor laying project at home, where he put down solid oak planks. This means we have a lot of 20 mm thick stock that's around 20 cm wide and between 25 and 35 cm long. I have long wanted to become more familiar with CNC milling and I have looked a lot at other DIY projects involving map data. So it quickly became obvious that i had to combine it all to make a map-shaped family photo for my father this year.
The island I am cutting is 'Lolland' in Denmark, where I grew up and where my parents live and the photo engraved is a recent family photo we took this summer. The coastline of the island will be cut with a normal bit and the fine details will be carved in with a V-bit.
Supplies
Materials
- Flat piece of nice wood
- Flat piece of scrap wood
- Map data of desired area
- Photograph for engraving
Tools
- CNC Cutter
- This project was done on a X-carve
- Laser Cutter
- In our FabLab we have an Epilog Helix 40w
- Sandpaper
- Normal CNC bit
- I used a cheap 4mm 2-flute straight cut bit
- V-carve CNC bit
- This project was done on a X-carve
- In our FabLab we have an Epilog Helix 40w
- I used a cheap 4mm 2-flute straight cut bit
Software Used
- QGIS (free)
- Inkscape (free)
- Fusion 360 (free for hobbyists)
- Photopea.com (free)
Step 1: Download Map Data
To cut a piece of a map, you first need a digital map to work with. For this project, you could probably just take a screenshot of google maps, and convert it to vector in inkscape, for a good enough result. However, one of my goals with this project was getting more familiar with official digital maps and the software used to manipulate them.
This approach requires you to find a supplier for maps in your area. In Denmark, this service is free at Kortforsyningen.dk and GEUS.dk among others, run by the Ministry for Climate, Energy and Supply.
https://download.kortforsyningen.dk/content/geodat...
https://frisbee.geus.dk/geuswebshop/index.xhtml
For most countries with a decent digital infrastructure, there should be an equivalent govermental body providing some sort of map service to the public for free or for a small charge. If this is not the case, there are also Open Source maps, such as OpenStreetMap to use. These will usually have less detail than the official local maps, but they can be sufficient in many cases.
For the Danish map suppliers, the map files are sold for 0,- Kr each in a "Webshop", where you have to register a user account. You can then put maps into your shopping cart and check out. This seems like a convoluted way of doing this, but there is probably some bureaucratic reasoning behind it.
Step 2: Importing Map Data Into QGIS
While the map data can come in many different data formats, it is uncommon for it to be in regular vector graphics formats like SVG or DXF. The reason is that maps are usually organized in many layers and each point, line or shape in each layer can have multiple additional metadata associated with it. As such we need a specific program to work with these files.
Enter GIS programs
The common name for this type of software is called GIS; "Geographic Information Systems", and like with every software category, there's multiple solutions to pick from. My search led me to find QGIS (www.qgis.org).
QGIS is a free and open-source cross-platform desktop geographic information system application that supports viewing, editing, and analysis of geospatial data. - Wikipedia
It doesn't get much better than that. The program has its fair share of tutorials available online, although it's not the mot common type of application out there, so be prepared to experiment a bit with the functions if you want to do anything advanced. For the purpose of this project though, it's fairly easy to use.
Isolate Relevant Data
Depending on your source for map data, you could have a bunch of unnecessary data in you downloaded files. For me, I had data on every road, church, highway resting spot, forest, marsh, creek and much more in the entire kingdom. While interesting data points for the right project, this was not it, and it makes the map really slow to work with.
To manage what we are working with, we need to be selective about what we import. The first time I attempted this, I just imported everything, and started deleting layers as I went. However I found out that it's much easier to go the other way and look in the files that you have downloaded and see if there's anything like "Land Area" or "Coastline" file you can use. After finding a promising file, you can just drag it into the QGIS window.
If the file structure is hard to navigate, you can often also just drag the entire zipped or extracted folder into QGIS where it will come with a dialog menu, where it will list all the recognized map files. Hold Ctrl and click the layers you want in your project.
Step 3: Cropping Map Data
As map data usually includes data for irrelevant areas, it is necessary to crop the map to only include what we want.
To do this in QGIS, click on "New Scratch Layer", change the geometry type to polygon and press OK
Next, click "add Polygon" and begin clicking around the landmass that you want to isolate.
When done, go to the menu in the top at click "Vector" --> "Geoprocessing Tools" --> "Clip"
Select the map data as the Input Layer, and the polygon you just created as the Overlay Layer. Click Run and exit the dialogue. You should have a new layer called "Clipped" in the list to the left.
Export your map by going to the top menu and click "Project" --> "Import/Export" --> "Export Project as DXF..."
You can now close QGIS.
Step 4: Adjusting the Vectors in Inkscape
Open up the DXF file in Inkscape.
Select everything (Ctrl + a).
In the top, change the X and Y coordinates to 0,0 to bring your shape into the paper.
Change the size measurement in the top to mm/cm/inches and resize the shape so it fits your wood piece. Click the padlock icon to preserve the aspect ratio, or hold Ctrl while dragging on the transformation handles.
Chances are that your geometry has a lot of points. In preparation for the next step, it is a good idea to reduce this as much as possible without loosing detail of the shape. Have your shape selected, go to the top menu and press "Path" --> "Simplify", or simply use the default keyboard shortcut Ctrl + L.
If there's any other alterations you want to do to the shape, this would also be a good time to do it.
Save the DXF file again.
You can close Inkscape at this point
Step 5: Generate CAM Gcode With Fusion 360
In Fusion 360, create a new design. Insert the DXF file into the design. Make sure that the size is still correct with the measure tool. If anything is off, either try altering the DXF file export in Inkscape, use the built in Scale tool (press S and type "Scale" to see it.) Extrude the path to the desired height of the final wood piece.
(NOTE: If you are more comfortable with another CAM software, feel free to substitute here.)
From here, follow the usual CAM workflow for Fusion 360. If you have not tried this before, check out a tutorial or video on the matter.
I used a Facing operation to flatten my piece, and then a contour pass to cut out most of the shape. Zero "stock to leave" for both. For this I used a standard CNC 4mm bit, straight cut.
Next I used an "Engrave" toolpath to make a V-bit go into the all the small grooves. However per default the Engrave toolpath will go on the inside of the coast line, instead of the outside. To remedy this, I went back into the "Design" workspace and created a spline path that went semi-coarsely around the perimeter of the island. Selecting this path as well as the coastline path, Fusion will run the V-bit on the outside, giving us the effect that we want.
As I had access to an X-carve, I also had to download a profile for Fusion 360 in order for it to be possible to post a correct file to it, rather than to use Easel, which I found limiting in its free version. For other CNC machines this may not be necessary.
Step 6: Cut on a CNC
When the G-Code has been generated, send it to the CNC with a G-code sender. I used Rabbit Gcode Sender, but Universal Gcode Sender is also highly regarded.
Hold down the piece of wood with either screws or double sided tape.
After running though the Gcode, go over the piece with some sandpaper to smooth out any rough edges and surfaces.
Step 7: Prepare Image for Laser Engraving
For the picture to be laser engraved, it is necessary to alter it a bit. A normal picture will usually have too low contrast to show up properly in a laser engraving. Also, when loading a color photo into the laser engraver, it will convert it into black and white in its own way. I would like to have control over that process. So I opened up Photopea.com, a free online photo editor, reminiscient of adobe photoshop. Good for small quick photo edits like this.
So, open the photo in Photopea, convert it to black and white as you want. Then increase the contrast as much as is feasible without losing too much detail.
I also cropped out the background as that would be messy when engraved on the wood.
This process was figured out through trial and error. I made a version of the photo, engraved it to a test piece of the same wood as my piece. Then I went back and forth until I had a photo I was happy with and that I had adjusted the laser settings to my liking.
Step 8: Laser Engraving of Photograph
For the actual engraving of the map piece, it is important to align it properly with the lasers coordinate system. However, map elements rarely has any nice straight lines that can be used for alignment. The solution I used was to first engrave the DXF file from earlier on a scrap piece. This gave me a perfect outline that I could lie the CNC cut piece on top of. I could then import the altered photograph into Inkscape and place it within the outline that I just engraved.
The piece turned out great, but for future similar projects, I will try to do more with the photo manipulation to make it stand out even more.