In this post I’m going to go through the process of turning any image into a physical reality. This technique can be applied to just about any image (.jpeg, .png, etc.) and computer numerically controlled machine. In this example, I will be making some signs for the Tech Toybox with a CNC router but it can also be used with a CNC milling machine or a 3D printer (which is, in essence, a CNC extruder). This can all be done using software and machinery at the Tech Toybox.
The overall process goes through three file conversions: .png to .dxf, .dxf to .stl, and .stl to .gcode. Each conversion will use a different program: the first will use Inkscape, which is a freeware version of Adobe Photoshop. The second will use AutoCAD, which is free to use for students. The third will use MeshCAM, which is a paid software of which the Tech Toybox owns a copy. Please note that there are probably a dozen ways of doing this with various programs that can make certain things easier or harder. If you want to do this with a 3D printer, you’ll likely want to use Slic3r or similar software instead of MeshCAM.
In any case, the first step is to import your image into Inkscape using File->Import. The result will look like this:
We are using Inkscape to translate this file into something that can be manipulated with AutoCAD. Inkscape uses a neat bitmap tracing engine called Potrace. To use it, go to Path->Trace Bitmap… and you will see a popup that looks like this:
The bitmap tracing engine provides multiple methods that may be more or less appropriate for different images. This part is less of a science and more of an art. The Tech Toybox logo turns out to be a rather complicated image with gradients and lots of fine details. You should try every different method, clicking on the update button after changing settings to see any differences. The best method I could find in this case was Edge detection with the Threshold turned all the way up to 1.000. Multiple scan methods would seem to give you a more detailed vector image, but it makes life difficult with AutoCAD.
Once you are satisfied with the vector image, click ok and Inkscape will create the vector directly on top of the bitmap:
To be able to open this file in AutoCAD, you will need to save it as a .dxf (File->Save As).
Opening the file in AutoCAD, the vector image looks pretty ugly: For whatever reason, the Potrace engine traces an inner and outer edge. I ended up going through and deleting most of the inner parts while keeping the outer ones and then joining them all together. The bottom left cube face I simply ended up redrawing. I wanted to put the logo on some signs for the Tech Toybox so I created a rectangle and text with appropriate dimensions.
The end result looked like this:
From here, things become pretty simple and straightforward. To extrude text in AutoCAD, first you need to blow it up! This can be done by selecting the text and then typing TXTEXP. After this, you have all that you need to begin creating the .stl mesh.
Open the 3D Basics tab, and then create planes inside each region of the 2D image using the PLANESURF function, then extrude, subtract, or union depending on what parts you want going in and out. Note that you will probably want to create planes one at a time for clarity’s sake. For these signs, I started by extruding the outer rectangle, text, and cube faces downwards. Then I subtracted the faces and text from the rectangle. Finally, I extruded the star, light bulb, and gear downward and united them all together into a single object. I also added an outer hexagon for the sake of having defined edges on the sign. The result looked like this:
Finally, it is time to output the .stl mesh which every version of AutoCAD should be able to do with File->Export (other formats, Lithography (*.stl)).
Opening the Main Office sign .stl in MeshCAM looks displays the mesh I just made with AutoCAD:
To use this with a CNC router, I then defined the stock so that the outer edge is larger than the bit diameter (in this case, ⅛” end mill or 3.175 mm). If the stock isn’t at least a bit diameter larger than the mesh, you will get some pretty ugly cuts around the edges. Using speeds of about 50 inches/min, I then generated a toolpath with waterline and pencil cleanup finishing. For whatever reason (the problem, indeed, could lie between the chair and keyboard) MeshCAM doesn’t seem to allow features that are too close in size to the bit diameter. This is why the text is fairly large, if you were wondering.
In any case, this is how the toolpath ended up:
Now we can make ten million! Or just one for now. Here is a picture of the CNC router partway through along with some other signs:
After that, jigsawing them out and using a table router to bevel the edges was a simple matter:
After some sanding and staining, I think they turned out pretty well: