If you normally delete your STL files after converting to G-code, you might eventually find yourself needing the STL again. If you find yourself with G-code for a file that no longer exists and you want to make changes – or use it with a different slicer, you may want to convert it back.
If so, there are only a few options you can try and none of them are very simple. However, with the right tooling, you can do the job.
While you can convert G-code to STL, it’s error-prone. You’ll have to manually remove information like supports, temperature settings, etc.
This means it’s always better to simply save your STL files so you don’t have to convert back from G-code. However, if you have to, this article will help.
Why Convert G-Code To STL?
Most slicers function to convert STL files to G-code. It’s very rare to have to convert the other way around.
In most cases, the only reason you’d have to would be that you either lost the original STL file, deleted it to save space, or downloaded someone else’s project off the Internet. In any case, you’ll never be able to get a perfect STL by converting from G-code.
Many people convert STL files to G-code and then delete the STL file. That could mean you don’t have the STL and you might need it if you want to re-slice the code using standards from a different 3D printer.
That’s especially true if you want to re-slice the file at a higher quality. However, there will be a significant amount of work involved in rendering from G-code to an STL, so this will rarely be worth your time or effort.
If you decide you have to make additional changes in your CAD program, you might need the STL file.
If you’ve already deleted that file, you won’t have any options except to convert it back from STL. However, making changes in G-code can be relatively simple.
It’s a good idea to explore those options before you try converting your G-code back to STL, because that may be more accurate and less time-consuming.
If you want to change small details like the supports, number of walls, etc., you’ll have to re-slice the file.
That will mean having the STL on hand.
How To Convert G-Code To STL
There’s only one way to convert G-code to an STL file. That is to use a tool to export the G-code in the format you want.
Here, you can use a range of tools as well as some slicers. Each has its own pros and cons.
1. Choose a Tool
There are several tools you can use to convert G-code to an STL file.
Each of them uses a different approach and most will cost money.
- Cura – Cura’s slicer allows you to export sliced G-code as an STL file. However, this gives you a rendering of the basic shape, meaning you get something more like a wireframe than the original model. Still, that’s easier than starting from scratch if you want to re-design the model in a CAD program.
- Voxelizer – Voxelizer is another slicing tool. It has a slightly more sophisticated G-code to STL converter, where it converts a file to “voxels” (large pixel analogous elements), which you can then export as. The smaller your voxels, the more accurate the results.
- GCode2L.com – This free platform converts simple and small G-code files to STL files.
Each program has pros and cons. Of these, Voxelizer is the most advanced, but also the most expensive. Integral Reality Labs may also introduce conversion features as they purchased the very popular MakePrintable – which had the best-rated G-code to STL file conversion solution on the Internet.
You may also be able to use Microsoft 3D Builder, Fusion360, NetFab, Rhino, and Z-Brush to convert G-code to STL. However, often, you’ll want to export the wireframe from your slicer and then repair the mesh in these tools – as that will be faster.
So, you may have to go through several tools to get the results you want.
2. Import Your File
Import your file to your chosen tool and look at the settings.
For example, on Voxelizer, you’ll have to set the size of Voxels. On Cura, you’ll have to set the line width. Then, export your file.
It’s a good idea to pay attention to details like line height, wall thickness, etc. For example, Cura notoriously renders slightly small, which means you’ll have to fix that post-conversion.
Voxelizer, on the other hand, should use voxels that are smaller than the line height. However, if your line height is 1mm or higher, you can go with a 1 mm voxel.
Otherwise, there’s not much you can tweak when exporting a file.
3. Export as STL, Then Clean Up the File
File export can take as long or longer than slicing the original file. However, once it’s done, you can open the STL in a CAD file. From there, you’ll have to remove extra details like supports that may have been in the G-code.
Here, supports are normally the largest addition. However, if you used brims, rafts, added extra layers to the bottom, or had any form of additional supports – those will be in the new STL file. You’ll have to manually remove them in your CAD program.
This can make even creating a wireframe in Cura challenging, because you’ll have to figure out which parts are the model and which parts are the support on your own. That could require some trial and error depending on what you’re working on.
You’ll also have to fix any model issues. For example, Cura exports a wireframe, which you’ll have to build on and add layers to. Voxelizer creates a “voxelated” file that you’ll have to smooth out to create a solid piece.
Each conversion method has its own pros and cons, so it’s a good idea to look at each and decide what you’re most capable of fixing yourself.
Common Issues When Converting G-Code To STL
Converting from G-code to STL is error-prone and difficult. Often, it’s best to avoid having to do this conversion.
Buying an external hard drive to store STL files so you have more storage on your computer will be better than converting G-code back to STL.
Unwanted Data in the File
When you convert G-code to STL, it will bring all of the sliced data settings with it. That will include things like supports. You’ll also get line height, temperature, and other settings.
The best G-code to STL file converters ignore all data but shapes so you won’t have a great deal of unwanted data. However, you’ll still have to manually remove supports from the model in your CAD program. That can be significantly time-consuming.
And, if you print the supports as part of the standard model, they’ll be much more difficult to remove than if you print them with support standards.
File Format Incompatibility
G-code files don’t always convert well to STL because the G-code includes print instructions for the printer. On the other hand, the STL file is a physical 3D shape.
Converting between these two formats can be extremely difficult because the converter has to assess what shapes were wanted and reconstruct those.
Most create either wireframes or basic shapes using smaller particles, which you can then finish and render in your 3D print program.
The more complex your 3D print model, the less likely you are going to be able to translate it back to STL.
You’ll get an approximation of the original, but it will be just that. And, you’ll likely need significant 3D modeling skills to repair the resulting model.
If you’re converting with complex geometries, your best option is to use Voxelizer or to use Integral Reality Labs. Both will likely cost money.
In addition, you’ll typically have to put in significant work to rebuild the model after converting the file.
Converting a G-code file to an STL file creates an approximation of the original. Different modeling programs take different approaches.
For example, Cura creates a wireframe, which you can then build on in AutoCAD or another 3D modeling program.
Other programs use smaller pieces to rebuild the model, which will also have a very low resolution. This means that you’ll have to repair the model and increase the size in order to re-slice it.
Converting from G-code to STL is an uncommon process because it’s difficult and error-prone. Even if you use an automated conversion tool, you’ll still spend a significant amount of time rebuilding the file in your CAD program.
Therefore, the best option is to always ensure you save copies of your G-code, even if you have to set up a backup disk just for this purpose. Often, an external hard drive is cheap and will save you quite a few hours of design work over fixing a single STL file pulled from G-code.
If you absolutely have to convert from G-code to STL, good luck with your file conversion and fixing it up afterwards.