Articles on: SimplyPrint features

All about the Gcode Analysis feature

In this article, we'll cover the mysterious "Gcode Analysis" that SimplyPrint performs on any printable file you upload through our platform.


What is the Gcode Analysis?


When you upload a file to SimplyPrint that can be printed - often times a .gcode file, we read through the entirety of the file's content, to gather information about the file, that is used in many aspects of your SimplyPrint usage.

Once a file is uploaded, the Gcode Analysis kicks in, reading through the entire file, line-by-line, with the goal of finding some specific information, such as; filament usage, print area, what slicer was used, and much more.

You can see that the Gcode Analysis is ongoing, if you spot a purple progress bar during your file interactions. The majority of times, the Gcode Analysis takes less than 3 seconds, but for very large files, ~100 MB+, you may notice it taking a bit longer.

That's a brief overview of what the Gcode Analysis is and does. Now, let's dive into further details and the more technical aspects. If you don't feel like you need to know more than this brief overview; no need to keep reading!

Where is my file analyzed?


Your file is currently analyzed 100% on your local device, in your browser or in our mobile app. This means it's not a cloud-powered analysis, and it also means that if your PC is very old and slow, it may impact the speed of the analysis.

In the future, we may move some of the Gcode Analysis aspects to being cloud-powered, running on our servers rather than your device.


What is the Gcode Analysis used for?


The Gcode Analysis is used in many aspects and corners of SimplyPrint. Let's break them down;

Checking if the print you're about to start fits on the bed
If you're using our filament system, and have a spool assigned to the printer, we can check if the printer has enough filament left to complete the job
If the printer has the right nozzle size for the given print
Tagging help: with our "auto-tagging" feature, the Gcode Analysis result is used to automatically apply material tags, such as the color and material type to the file, which is then matched against the printer, to check if the printer has the right colors and material types
Temperature checks: this is an important one. By knowing what temperatures the given print is supposed to print at, we can check if the temperature is higher than what the printer allows, or if it's higher or lower than the temperature range of the material assigned to the printer, thereby catching potential issues of trying to start a PLA-sliced print with PETG material on the printer
Information for your convenience; a lot of the extra data we gather, such as the layer height, is not directly used by the system, other than to provide you with more details about the file


How does it work?


As the gcode format is quite simply a text file with a bunch of lines, each line being a command for the printer, such as "move!" or "extrude", or a "comment" which is not processed directly by the printer, it's easy for us to read it.

Our Gcode Analysis analyzes every single line of your Gcode file from top to bottom, analyzing a variety of things.

We process comments and commands alike, as the comments often times carry information that the printer might not explicitly need, but that platforms like SimplyPrint, as well as slicers and other software, might find use in. This could be the name of the slicer, for example.

What slicers are supported?


In theory; all slicers! But, as different slicers can produce a very different output from each other, we do have to specifically implement support for slicers, to get all the details we'd like.

The supported slicers are;
Cura
Creality Slicer
Simplify3D
The SimplyPrint Slicer (Kiri:Moto-powered)
Kiri:Moto
KISSlicer
Flashforge Slicer
Slic3r
PrusaSlicer
SuperSlicer
BambuStudio
OrcaSlicer
BambuStudio-SoftFever (now called "OrcaSlicer")
A3dp-Slicer
CreatWare
Canvas
REALvision Online
CraftWare
Fusion 360 slicer
MatterControl slicer
Creality Print

Are we missing any? Let us know - contact us!


Can I disable the Gcode Analysis?


No. We made the choice to remove the option to disable the analysis, as it plays an integral part of the SimplyPrint ecosystem.


What information is gathered?


This is the full list of data that we can gather in our Gcode Analysis. Note that some slicers may give us less information, so we may not always get all of this info, but in the best case scenarios, we will.

Each item is marked by "➕" if it's an item that is based on us reading and analyzing the code, and "🔘" if it's info from a Gcode comment that we read and save without further analysis.

Print Area: The boundaries within which the printing occurs, detailing maximum and minimum coordinates on X, Y, and Z axes. ➕
Movement: ➕
- Extruder Relative Movement: Indicates if the movement of the extruder is measured relative to its previous position.
- Movement Relative: Indicates if the movement of the printer head is relative to the last known position.

Temperatures: ➕
- Bed Temperature: Temperature of the print bed.
- Tool Temperatures: Details the temperatures for the tools used, primarily focusing on the extruder temperatures. Disregards "flush" temperatures for when swapping filament.
- Maximum Tool Temperature: Highest temperature that can be used across all tools. Includes "flush" temperatures.

Model Size: The dimensions of the 3D model that will be printed, including width, depth, and height. ➕
Material Data: Information about each type of filament used, if specified by the slicer in Gcode comments, including: 🔘
- Type: The type of material, such as PLA.
- Color: The color of the filament, given in hexadecimal code.
- Density: The density of the filament material.
- Diameter: The diameter of the filament.

Slicing Software: The software used to slice the model for printing. 🔘
Slicer Version: The version of the slicing software that was used. 🔘
Estimated Print Time: The estimated time required to complete the print, given in minutes. This is always specified by the slicer in Gcode comments. 🔘
Filament usage: Lists the amount of filament used for each tool, measured in millimeters. ➕/🔘
Some slicers give their estimate of the filament usage per extruder in a Gcode comment, in which case we use that. But, as a fallback, we count the filament usage all throughout the file, and gather our own filament usage estimate.

Nozzle Size: The diameter of the printer's nozzle. 🔘
G-code Flavor: The type of G-code used, which depends on the printer's firmware. 🔘
Layer Height: The height of each layer that the printer will lay down. 🔘
First Layer Height: The height of the first layer, if it differs from the rest. 🔘
Total Layers: The total number of layers that will make up the completed print. ➕/🔘
Some slicers provide a comment such as ; TOTAL_LAYERS=[XX], while for other slicers we have to count the amount of times there's a line saying ; NEW LAYER (or something similiar)

Minimum Delta Radius: The minimum radius a delta (round) printer bed would be required to have, to print this file. ➕
Printer Model: Specifies the printer model for which the G-code is optimized. 🔘
Problematic / "Malicious" Gcode Lines: Notes any lines of G-code that might cause issues during printing. ➕


Gcode comments format: "manipulation" & what you can add manually


Knowing what we look for in the file to find certain details, that we count on the slicer putting in a Gcode comment (; comments look like this, with starting ";"), can help explain why the Gcode analysis may not find some information for your specific case, and it can also help you get a better Gcode Analysis output, by potentially "manipulating" it, adding or modifying Gcode comments that we pick up.

The main comments we pick up, are;

Nozzle size:


Example: X = 0.4
Simplify3D: ; extruderDiameter,X
SimplyPrint slicer, PrusaSlicer, OrcaSlicer, SuperSlicer, BambuStudio, A3dp-Slicer, CreatWare: ; nozzle_diameter = X
Cura: ;EXTRUDER_TRAIN.0.NOZZLE.DIAMETER:X - often times not set, though, unfortunately

Layer height:


Example: X = 0.2
SimplyPrint slicer & Kiri:Moto: ; sliceHeight = X
Simplify3D: ; layerHeight,X
PrusaSlicer, OrcaSlicer, SuperSlicer, BambuStudio, CreatWare, Creality Print: ; layer_height = X
Cura: ;Layer height: X

Total layers:


Note: Some slicers don't provide us with a Gcode comment containing the amount of layers, but in these cases, we count the layers manually by counting; ;LAYER_CHANGE (Prusa), ;; --- layer (SimplyPrint, Kiri:Moto), ; layer (Simplify3D).
Example: X = 0.4
SimplyPrint slicer & Kiri:Moto: ; sliceHeight = X
Simplify3D: ; layerHeight,X
SuperSlicer, OrcaSlicer: ; total layers count = X
BambuStudio: ; total layer number: X
Cura & Creality Print: ;LAYER_COUNT:X

What printer model the slice is for:


Example: X = Creality Ender-3 Pro v2
SimplyPrint slicer, PrusaSlicer, OrcaSlicer, SuperSlicer, BambuStudio, A3dp-Slicer, CreatWare: ; printer_model = X
Creality Print: ;Machine Name:X

Filament usage:


Example: X = 1000 or 100,1000,520 (on multiple extruders)
Note: filament usage is always calculated for any slicer; but, for some slicers, we use the Gcode comment instead of our own estimate.
PrusaSlicer, SuperSlicer, OrcaSlicer, A3dp-Slicer, CreatWare: ; filament used [mm] = X

Filament color:


Example: X = #FFFFF or #FFFF, #0000 (on multiple extruders) (HEX color code (#FFFFF), not color name)
SimplyPrint slicer, PrusaSlicer, SuperSlicer, BambuStudio, OrcaSlicer, A3dp-slicer, CreatWare: ; filament_colour = X

Filament type:


Example: X = PLA or PLA, PLA, PETG (on multiple extruders)
SimplyPrint slicer, PrusaSlicer, SuperSlicer, BambuStudio, OrcaSlicer, A3dp-slicer, CreatWare: ; filament_type = X
Creality Print: ;Material Type:X
Simplify3D: ; printMaterial,X

Filament density:


Example: X = 1.24 or 1.24, 1.25, 1.24 (on multiple extruders)
SimplyPrint slicer, PrusaSlicer, SuperSlicer, BambuStudio, OrcaSlicer, A3dp-slicer, CreatWare: ; filament_density = X
Creality Print: ;Material Density:X
Simplify3D: ; filamentDensities:X

Filament diameter:


Example: X = 1.75 or 1.75, 1.75, 1.75 (on multiple extruders)
SimplyPrint slicer, PrusaSlicer, SuperSlicer, BambuStudio, OrcaSlicer, A3dp-slicer, CreatWare: ; filament_diameter = X
Creality Print: ;Material Diameter:X
Simplify3D: ; filamentDiameters:X

Gcode flavor:


Note: this is not currently used for anything. It's not displayed for the user and not used by our systems. It's there in case it's found useful in later versions.
Example: X = Marlin
SimplyPrint slicer, PrusaSlicer, SuperSlicer, BambuStudio, OrcaSlicer, A3dp-slicer, CreatWare: ; gcode_flavor= X
Cura, Creality Print: ;FLAVOR:X

If your slicer is not mentioned on this list or for a given gathered detail, it's most likely because - to our knowledge - the slicer does not provide us with the information we need, via the Gcode comments. As the info we look for is based on which slicer we've gathered you use, it's not possible to simply paste in the comment from a supported slicer, into an unsupported one - it still won't be picked up. This is done to keep the analysis fast, as the more data we try to look for in each line of the Gcode file, the longer the analysis takes.

Flush temperatures & ignored Gcode lines


More and more modern 3D printers perform a bunch of stuff before starting printing, such as more advanced "prime lines", flushing the nozzle and purging outside the bed.
This in turn can result in a less "accurate" Gcode Analysis, as the analysis picks up the movements outside the normal bed area, which results in inaccurate print- & model-size estimations, as well as the Gcode Analysis thinking the print is printed at a higher temperature than it actually is, in case it picks up a "flush" temperature, meant to remove excess / old filament, which is often done at higher temperatures than the actual print.

To combat this, the SimplyPrint Gcode Analysis intelligently ignores some movements, temperature settings and extrusions, if it happens prior to the point in the Gcode file, where we deem the print actually starts. This is split up into 2 parts; "Gather info after [...]", and ignored flush temperatures;

"Gather info after [...]"


For 13 different slicers, we won't start counting material extrusion, calculate printer moves or save temperatures, before a certain line appears in the Gcode file;

Cura, Creality Slicer, Creality Print: ;LAYER:
SimplyPrint slicer, Kiri:Moto: ;; --- layer
PrusaSlicer, CreatWare, A3dp-Slicer: ;LAYER_CHANGE or ;AFTER_LAYER_CHANGE
SuperSlicer, BambuStudio-SoftFever: ;LAYER_CHANGE
BambuStudio: ;========turn off light and wait extrude temperature ============= or ; CHANGE_LAYER
OrcaSlicer: ;========turn off light and wait extrude temperature =============, ;LAYER_CHANGE or ; CHANGE_LAYER

If we never find the "Gather info after..." line, we fallback to analyzing the whole file.

Ignored flush temperatures


Regardless of slicer, the line ; FLUSH_START triggers a halt in looking for temperature Gcode being set, and ; FLUSH_END resumes the search. This means, anything between those lines will be ignored, temperature-wise. The temperature is still logged as the "max temperature" of the print, but not as the main temperature of the print. This means, that we will still be able to warn you, if the temperature is something ridiculous like 2000 degrees, or in any case; if it's over the maximum temperature setting for your extruder.

Furthermore, if a temperature-line includes the word "flush" (in a comment), the temperature is ignored exactly as described above as well.


Processed Gcode commands


This is the list of specific Gcode commands that we in some way process during the Gcode Analysis.
Note that we do process more lines than this, but they may be conditionally based on which slicer we detect you're using. This list contains the static commands, always processed, regardless of slicer;

Movement & extrusion: G0 and G1


Note: `G2` and G3, "Arc movement" support is coming soon.
Movement & extrusion Gcodes. Used to track where the print head is, calculate the size of the print area and model, as well as count extrusion.

Set position: G92



Set hotend temperature: M104 and M109



Set bed temperature: M140 and M190



Klipper start macro: START_PRINT


The START_PRINT macro line must include EXTRUDER_TEMP=X and/or BED_TEMP=X (replace "X" with actual temperature, of course)

Extrude & move relative vs. absolute: M82, G91, G90, M83




List of Problematic Gcode commands, marked as "malicious"


This is the list of commands we have on our "malicious Gcode" list. They have been deemed, by the SimplyPrint team, to have no business being in a normal printable file.
So, if your Gcode file contains one of these commands, we'll warn you about it.

In some cases, especially when as new printers hit the market and 3D printers are improved, this list might need to shrink or grow - feel free to let us know if you believe we should add or remove any commands from this list.

M999
M997
M995
M951
M915
M914
M910
M912
M906
M871
M851
M672
M666
M665
M575
M512
M502
M501
M425
M305
M304
M303
M218
M200
M149
M112
M30
G20

Updated on: 19/04/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!