Guide: Get Familiar with CNC File Formats

There’s a range of different file format that comes to mind when you’re working in the CNC milling area. We’ve compiled them here with a quick roadmap on how to use them and how to bring them to your workflow when using your Mekanika EVO or PRO CNC milling machines.

On one hand, it is important to understand design files, that needs to go through a CAM software in order to generate G-code and be used by a machine.

On the other hand, you may run into different G-code files depending on which post-processor you used in your CAM software and on the control software of your machine. It is also important to understand those files and to see if they may be converted from one another.

CNC Design files

Let’s start with design files. There are 3 types of files you may run be using if you’re working in the creative sector : 2D vector files, raster files and 3D files.

Vector files

As opposed to raster files that are made of pixels, vector files are made up of objects, which makes highly compatible with CAD software. You can easily import this kind of files, re-scale or modify them without any trouble. Some vector file formats are particularly relevant to use when moving to a software like Illustrator to a CAD software : *.dxf, *.dwg and *.svg files.

DXF

Short for Design eXchange Format, DXF files have been created by Autodesk (the company behind Fusion360) and has become a standard format for exchanging designs between different CAD software, and other creative tools by extension. It’s open source and therefore accessible by a wide range of applications.

DXF files are particularly relevant if your designs are 2D vector images, that can then converted into G-code with your CAM software in no time.

Our control software, PlanetCNC, even has a direct DXF file import option, allowing you to go directly from design to milling if your design is specifically 2D and contains only contour operations.

DWG

DWG are similar to DXF and have also been created by Autodesk. They’re the native format of AutoCAD and have the advantage of supporting 2D and 3D images. They can easily be imported in Fusion360 to convert them into G-code files. However, they’re not transferable to another software.

SVG

Short for Scalable Vector Graphics, SVG files have been developed for web-based work. Most web browsers and design application support the SVG format. They’re not particularly used in CAD software but can be imported into Fusion360 to turn them into G-code.

Raster files

Raster files are files made of coordinates of data, like images made of pixels. Common file extensions for raster files are *.png, *.jpg or *.tiff. If you’re in possession of a raster file and you’re looking into using it for CNC milling, you’ll first need to vectorize your image into a usable extension before being able to turn it into G-code.

We would recommend using a dedicated software with human supervision to vectorize your file, like Adobe Illustrator. However, if you have no other possibility, there are several rasters to vector convertor online that can turn your image into a usable file.

3D files

The same way DXF has been used as a standard to exchanging 2D vector files between applications, the STEP format (*.step, *.ste, *stp) stand as a standard for 3D files. It will allow you to design your piece in one CAD software and still be able to open it in another one, even though some editing options can be lost between software. However, you will always be able to open STEP file into a CAM software like Fusion360 in order to generate G-code from it. We believe it’s the best format to exchange files for milling if you’re working with other 3D creatives.

Alongside STEP files, every company has its own file system, like Solidworks (*.prt, *.asm, *.sldprt, *.sldasm), SketchUp (*.skp), CATIA (*.CATProduct, *.CATPart), Inventor  (*.ipt, *.iam) or Fusion 360 Archive (*.f3d).

Machining Files (G-Code files)

G-code files are always very simple text files with command lines. The most common file extension for G-code are *.nc files, which is the format used by our machine. However, several other extension exists like *.cnc, *.ngc, *.gcode or *.tap. Deciding which one to opt for generally depends on which one is going to be compatible with the CNC machine (or other hardware) you’re using. You can always open those files with a text editor in order to analyse commands lines (that’s where knowing a bit of G-code can become handy).

One particular issue with G-Code files is that you cannot convert one g-code file into another : there’s no reverse opening of a G-Code files by CAM software to make it go through another post-processor compatible with your machine. So, when sharing CNC works, make sure that you always share CAD or vector files and generate your G-Code by yourself.

Video Tutorial: Turn Your Drawing Into a 3D CNC File


About Mekanika

Mekanika is a Belgian startup based in Brussels whose ambition is to make local production more accessible. We produce desktop machines for screen printing and CNC milling, which have been recognized for their quality and ease of use, with open source plans allowing makers to adapt their tools to their specific needs. 

Visit our shop to find out more, or check out our tutorials to continue learning.

Sign in to leave a comment