GCode2vtk can be used to convert the information about the toolpath and machine settings included in every GCode file to a .vtk file that can be visualised in paraview. This process works on GCodes of different processes like Fused Filament Fabrication (FFF), Laser Powder Bed Fusion (LPBF) and Arburg Kunststoff-Freiformen (AKF - only old file format).
The tool makes it possible to visualise the used toolpath of all parts in a build job and to show process settings such as laser power or nozzle temperature, scan speed, the length of single paths and various other useful information.


Simply call the supplied executable with suitable options.
You obtain a .vtk file that you can open and view in Paraview, which enables you to visualise and analyse the data.
Availabe options can be accessed by calling:
.\GCode2vtk.exe --help
which lists all options.
In short: You need to specify the filename of the GCode to be read and the type of machine the code belongs to (FFF, LPBF)
.\GCode2vtk.exe --fff -g PrintJob.gcode
Long explanation:
Often in the GCode file there are a few coordinates that do not belong to the object itself, such as skirts, rafts, brims etc.
Therefore, you need to specify, where to start the information extraction.
One option is to specify how many SubPaths should be ignored before object starts. A sub path is the term used here for a single printed line. Default is 1 to get a well defined first point. You can adjust this by calling GCode2vtk with --startbypathoffset (number). Then the trajectory will be extracted after (number) sub paths.
Another method is to specify a string of a line in the GCode file, where to begin extracting the information. This string has to be unique!
| short option | long option | description |
|---|---|---|
| -g | --GCodeFilename | GCode filename |
| --lpbf | process GCode file in ORLAS LPBF compatibility mode | |
| --fff | process GCode file in REPRAP FFF compatibility mode | |
| --akf | process GCode file in Arburg freeformer compatibility mode | |
| -h | --help | output help message |
| -u | --translation | vector to translate GCode (as string): "x y z" (mm) |
| -a | --rotation | rotation angle about z-axis, y- and x-axis; order: (x y z) |
| -s | --startbystring | if specified GCode will be extracted starting from this string (has to be unique!) |
| -j | --startbypathoffset | object starts arg subpaths from start (default = 1) |
| -q | --endstring | string until which GCode will be extracted (default = ;End) |
| --vtkfilename | specify a filename for .vtk file (default = toolpath.vtk) |
The translation and rotation options allow to register the visualised toolpath to a volumetric image from e.g. a µCT image to covisualise the information.
.\GCode2vtk.exe -g GCode.gcode --fff -j 3 --vtkfilename "outputfile.vtk"
If you intend to use this work for your scientific publication please cite https://doi.org/10.1016/j.jmatprotec.2021.117331
For the most common errors, GCode2vtk should output helpful information about the error.
If not, try the following:
If this doesn't help:
* open a ticket and supply an example GCode