CNC Smoothing – How to Optimize a Design for CNC Cutting

Updated Sep 30, 2021
cnc smoothing, scan2cad logo

CNC veterans will regularly need to produce CNC files that are suitable for cutting. Most of the time, that includes taking a design and converting it into a vector file format that CNC machines can read. Taking it a step further, before even running that vector file through the machine, some CNC machinists will take the time to optimize these vectors for a smooth and high-quality end product.

All these steps might seem a little overwhelming, but Scan2CAD can execute all of them for you without a fuss. We’ll go through all of these steps in the article today, but let’s first start with a demonstration of how Scan2CAD can optimize your CNC designs for cutting.

View video transcript

In this tutorial, I’ll show you how we can use Scan2CADs to smooth the vectors in an image to make it suitable for CNC cutting. So when we talk about CNC smoothing, what we’re effectively trying to achieve is the reduction of vector nodes in a vector image. So I have an example here, we have a vector image that I have just mocked up, and we can see if we select the elements, hopefully, you can see that each of these elements here is formed of thousands upon thousands of individual vectors. You can see I’ve just dragged one out here. So these curves… And this is common with unsuitable CAD2CAM software, they’ll create CADs using thousands and thousands of these elements.

Now there’s a few problems with that. One, your CNC machine is gonna really struggle to follow all of these instructions ’cause what we’re going to do is take this vector image compare it to G-code or DXF, and that’s effectively used as a cutting path by your CNC machine. So it knows that it’s going to have to follow this bit to this bit to this bit to this bit, so on, and it’s a real struggle for your CNC machine. The second problem is that if you don’t have a fully optimized design with as few vectors as possible, it’s gonna look really ugly if you scale it up. So you can see again that this curved section here is formed of many vectors. If you were to scale that up, it wouldn’t be curved, you’d have jugged shapes representing this. So again, that’s a problem. Luckily, Scan2CAD has CNC Smoothing, which is a tool to reduce the vectors, making it suitable for CNC cutting. So let me just hit undo first to it to undo that vector edit. What we could do, as a demonstration, is have a look at the number of vectors in this box. We could go to the vector tab, choose false statistics, and we can see that within this fold, there’s actually 12,000 vector lines representing this image. And this is really common, again, with images created by unsuitable CAD2CAM software.

It’s a very simple process to smooth an image with CNC. We go to the convert vector image tool here, we choose the CNC smoothing tab, and in here, we can edit the defaults if you want to. If you’re not sure what you would need then I recommend just going with the defaults. We have the ability to set the arc radius, you choose either lines or polylines and so on, but we’re just gonna hit run. Now, let’s have a look at the result. So, previously, when I highlighted this vector image in Scan2CAD, we saw only red, but you can see now we’re seeing a lot of pink. So when you highlight an image in Scan2CAD, what it does is view the vectors by their type. So red represents vector lines and pink represents vector arcs. So what we’d see now is that those thousands of little vector lines in many cases have been converted into arcs. So let’s click okay, just to view this in the canvas, we’ll hit the highlight button again. So again, Scan2CAD has, where possible, reduced the vector elements to as few as possible whilst representing the original vector image. So we can see the head of this bird now is just one arc, and again, that’s as few arcs as possible whilst following the original profile of the image.

This is a really good example of how we’ve significantly reduced the number of vectors and made this image suitable with the CNC cutting. The final step is just to save out the file now. You could use the quick export button or go to the File, Save As vector. I’ll go for quick export. And from here, you can see that we can save as G-code format such as CNC, NC tap or DXF and DWG. Select the one you want, I’ll go for a CNC and we’ll call this Birds. It’s saved, and then you’ll see that you have CNC specific options here, such as the Z offset settings, if you’re not sure what these mean, just choose the tool tips to find out, and hit Okay to generate your file. So you’ve now created your DXF, G-code, or DWG file which can be imported into your CNC software for cutting.

Image types for CNC cutting

CNC machine working on steel

CNC machine working on steel Source

There are two things to consider before you can even start optimizing your image for CNC cutting: 1 – whether the image itself is suitable for CNC cutting and, 2 – whether the file format is suitable for CNC cutting.

Usually, when you deal with images for CNC cutting, you want to go for monochromatic images with minimal gradients. Colored images are a bit difficult to deal with since converting them to black and white doesn’t always work out well. Anything with midtones will either be converted to black or white when setting it up for CNC cutting and so a lot of the details will get erased. Gradients are an even bigger problem for the same reason. So when you’re designing or editing an image for CNC cutting, always note that the most suitable images will be monochromatic ones that can easily be turned black and white. 

When we talk about image formats, we’re looking at if the file you’re working with is a raster file or a vector file. Vector files are pretty straight-forward since the standard CNC file formats are also examples of vector files. If you’re working with a vector file – which you can tell if an image is one if it doesn’t get pixelated or blurry no matter how much you zoom in – you can go straight ahead to optimizing the file for CNC. If you’re working with raster files, however, the process is a bit more involved. You’ll have to convert that raster image into a vector file. 

Conversion options

Raster to vector conversion

Raster to vector conversion Source

When you need to convert an image for CNC, you have three options:

  1. Manually trace the image using your CAD program
  2. Convert using built-in conversion tools in your CAD program
  3. Convert with conversion software like Scan2CAD

Option 1: Manual tracing

Tracing an image meant for CNC use involves opening up your raster image on your preferred CAD program and using the software’s drafting tools to vectorize all the elements of the file by “tracing” over the image. It’s the digital equivalent of duplicating a blueprint by putting tracing paper on top and copying all the lines. The process is fairly straight-forward but can get tedious and time-consuming if the image you’re working with has a complex geometry.

Some CNC users actually prefer working with manual tracing since the user will have complete control over conversion accuracy, the number of vector elements and nodes in the image, and, depending on the skill of the drafter, the ability to convert even low-resolution raster files. Do note, however, that automatic conversion tools have developed and improved to the point where their accuracy is comparable to that of manual tracing executed at a fraction of the time.

Although some conversion programs can only do so much with low-quality raster images, it can still convert such files to a point where editing and correcting any inaccuracies would still take less time than manual converting the file from scratch.

Option 2: Built-in conversion tools

Some CAD and CNC programs will have built-in conversion functionality and can automatically vectorize any imported raster images. Not all CAD programs have these tools built-in, and even those that do will have their limits. Some of the more well-known vector software that has vectorization functionality are Adobe Illustrator and Photoshop and AutoCAD’s Raster Design.

Do note, however, that these conversion tools aren’t optimized for CNC. More than likely, you’ll have to do a once-over to see if all the vectorized elements are converted properly. Still, it’s much faster than manually converting the vectors through tracing.

Option 3: Convert with conversion software

In contrast to plug-ins that only add on some functionality to a CAD program, there are other stand-alone software that specializes in raster and vector conversion. Scan2CAD is an industry leader when it comes to those types of programs and for good reason. Scan2CAD has two decades of development and experience under its belt, resulting in a conversion solution for CAD, CAM, and CNC that is precise, efficient, and easy to use.

The program handles both raster and vector conversion. That is, if you have a raster file that you want to convert into vector elements, Scan2CAD can do that for you. It can also handle vector files whose formats you want to change. The program has sophisticated object and text recognition tools to make sure that conversion go as smoothly as possible.

Additionally, Scan2CAD has a CNC optimization mode that automatically takes any existing vector file and reduces the number of nodes and poly-lines for a smoother and faster cut.

Poor conversion results

Comparing an exploded vector circle with a circle entity

Comparing an exploded vector circle with a circle entity Source

How do qualify the type of results that we get from vector converters? A good metric would be to see if the program converts obvious arcs or circles into several small line segments. If the software can’t reliably produce arcs or circles, it might not be the best program to produce designs for CNC cutting. Smaller polylines aren’t ideal for CNC cutting because it makes the file unnecessarily complex with the sheer number of vector objects in the image. Not to mention, the CNC machine will sometimes create jagged arcs when you scale the design up.

In this type of conversion where all elements, regardless of the apparent curve, are converted into individual connected vector lines, optimization becomes a bit of a task. Not only do you have to manually erase the polylines, but you’ll also have to redraw these as arcs. Fortunately, Scan2CAD’s sophisticated object recognition as well as vector optimization tools solve all of these problems.

Object recognition simply means that if the raster image has graphics that are meant to show curves or circles, Scan2CAD will recognize this and also vectorize these elements as arcs or circles. Additionally, if you want to optimize your vector files even more, Scan2CAD can also process the image to minimize the number of vector objects and smoothen out any jagged polyline edges.

Raster text

When it comes to raster text, you’d usually want to go with conversion software that has good OCR capabilities. When it comes to CNC, however, things are a little bit different. CNC machines don’t normally handle vector text objects well, so your best bet is to convert any raster text into vector lines and arcs.

Scan2CAD has a reliable OCR conversion tool that lets you convert raster text into editable vector text. However, as in the case with CNC files, if you’d rather convert the raster text into vector lines, all you have to do is opt to go without OCR and Scan2CAD will turn that raster text into exploded lines and arcs.

Raster text and exploded vector text

Raster text and exploded vector text Source

Optimizing a design for CNC using Scan2CAD

When you have your vector file converted and ready to be used for CNC cutting, the last step would be to make sure that the file is optimized for the process. You can opt to do that manually by going through the image and smoothing out any jagged edges yourself, but automatic optimization solutions like Scan2CAD has are much more efficient.

Here are the steps for optimizing your design for CNC cutting using Scan2CAD:

  1. With your vector file opened up on Scan2CAD, right-click on the Vector tab header and choose File Statistics. This opens up a window where you can see the actual number of vector objects in the file.
  1. To optimize the vector, just click on the ‘Convert vector image’ tool at the top of the Scan2CAD interface. A dialog box should open up.
  1. Under ‘Conversion options’, be sure to tick ‘CNC Smoothing’.
  1. In the now available ‘CNC Smoothing’ tab, edit the settings as you see fit. If you’re not sure about what edits to make, the default settings are usually good enough left as they are.
  1. Click on ‘Run’ once you’re okay with the settings to generate a preview at the left side of the dialog box. You can click on the ‘Highlight vectors’  tool at the bottom-right corner of the preview window to have a more detailed look at the vector objects in the image. Red highlights mean the vectors are lines, pink highlights indicate arcs, and blue highlighted vectors are circles.
  1. If you’re happy with the preview and want to finalize the optimization, click on ‘OK’ to execute the changes. Once you’re back in the main screen, you can go ahead and click on the ‘Export’ option at the top-right of the interface and save your file under the file name and file format of your choice.

With Scan2CAD, the conversion and optimization processes are as easy and as efficient as they can be. Most images won’t take even 5 minutes to get ready for CNC cutting. If you’re a frequent user of CNC software and want to save time and money with the whole process, Scan2CAD is absolutely a must-have.

scan2cad advert for free trial