GCode Print Simulator

by mdietz, published

GCode Print Simulator by mdietz Jan 24, 2013


Liked By

View All

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

83437Views 20927Downloads


This application can visualize Gcodes and simulate a real 3D print.
GCode Simulator recognizes the print speeds and can simulate the print in realtime, but you can also speedup the prints (fast forward,slow motion). Each layer is painted in a different color to see how a layer overlaps with the layer below.

GCodeSimulator Home page: http://3dprintapps.de/

Video of GCodeSimulator in action: http://www.youtube.com/watch?v=i1SY2N21EDQ

GCodeSimulator let you to check how your print should turn out, making it easier to spot errors and fix them instead of wasting filament. If the print object looks ok you can directly send it over Wifi to GCodePrintr (Android) to print it.
GCodePrintr - 3D Printing for ANDROID available
Allows real 3D printing from an Android device

In addition GCodeSimulator analyses the Gcode file and prints additional information like:
It calculates various print details like
-print time
-used filament
-yx move distance
-print object dimension
-average print speeds
-number of layers
-layer details
-speed distribution / Acceleration
-weight and price of the printed object
-much more ...

It also allows to debug your gcode by stepping through it line by line and show the results. (debug mode)

Developed for my reprap printer but works with other printers (e.g. makerbot, ultimaker,...) as well, tested with Silc3r and skeinforge gcodes.

Download the latest Version V134


Add GCode Simulator as post-processing script in Slic3r !!

Latest Update V1.34
Many improvements for CNC (non-3dprint) gcodes
Fixed gcode parsing issues
Calculate filament usage by extruder
and more

How to start GCodeSimulator on Windows/Linux/MacOS
GCodeSimulator is written in Java and therefore requires a Java Runtime Environment (>=1.6) to be installed on the System. You can get the Java JRE from www.java.com (Oracle).
Once Java is installed you can start GCodeSimulator by double click on the GCodeSimulator.jar file. (Open with java from explorer or your favorite file browser.)
Do not extract the jar file ! (Windows explorer might show it as a tip archive)

If this does not work, please start GCodeSimulator by calling java from the command line
java -jar GCodeSimulator.jar [gcode_file]

[gcode_file] is optional , if not specified then a browse dialog will open.

IMPORTANT: Due to a bug in the linux java jre do not choose a file from the "recent file" list, this will cause a crash. Instead go to the full path of the file and open it there.

The GCode Print simulator can be controlled with the following hotkeys:

I have tested it with many Slic3r gcodes and some skeinforge gcodes. But GCodes can be very complex, therefore I'm pretty sure there will still be bugs.
Z-Lifts might causes problems and negative coordinates as well (fixed with V0.65). Relative positioning is not supported yet.
Feedback is highly welcome !

Old version history:

Update V1.32
Fix for G02/G03 gcodes
Fit to page zoom
more fixes

Update V1.30
Improved behavior when jumping between layers
Support for G00,G01,G02 gcodes
Thumbnail support - can be integrated with Nautilus

Update V1.29
New Snapshot Image function to create a snapshot of the model and store it as jpg. Helps to get an overview and categorize your existing gcodes.
Round print bed support
Many fixes

Update V1.27
Option to autostart print when sending gcode to GcodePrintr (>=V1.67)
Option to autosave model when sending gcode to GcodePrintr (>=V1.67)
Option to configure offset for dual extruder
Many bug fixes

Update V1.25
Added limited support for BfB style gcodes
Added "Jump to Layer" option
New button bar & banner
Fixed nozzle offset

Update V1.22
Configurable bed size
Gray and Autumn Themes

Update V1.21
New Button bar
Layout changed
New print panel (not working yet)

Update V1.18
Fix wrong label painting
Remember Network IP
Remember last file path
Update V1.17
Many performance improvments
GCode Parser improvements
Paint Extruder on frotn view
Workaround for MacOS load bug

Update V1.16
Fixed problem when parsing gcodes with multiple whitespaces

Fixed NullPointerException with G4 gcode

Fixed Network Send Feature (broken in V1.12)
Improved load time

Add makeware specific extrusion code ( A&B instead of E)
Removed debug message which slowed down the load
Fixed side view, slicer comments view, 1st layer temp
Removed experimental edit mode (speek up if you need it!)

Add makeware specific extrusion code ( A instead of E)
Fixed boundary calculation (start position was ignored)

Improved performance
Significantly reduced memory usage

-New Network Send (Remote Print) Feature - allows you to send the Gcode to an Android device running Gcode Simulator V1.05 Beta.
-Added new menu items for the functions added in V1.02
-Fixed Z-lift Bug (layers were reordered by Z-pos)

UPDATE V1.03-V1.06
Various updates to the Android Beta Version

Fixed some ReplicatorG Bugs
Fixed some "Invalid Gcode" errors by adding support for addtl. Gcodes (M204,M70,G161,...)
Show current Gcode line when in pause (debug mode)
Added step by step execution (debug mode). Use space/backspace to step through the gcodes during pause
Added fast forward/rewind (skip 50 gcodes). Use space/backspace during run.
Added increase/decrease of speedup in larger steps (10x). Use / (Up) * (Down)

The current location of the nozzle is painted to improve usability.
Replaced blue with a lighter pink to improve readability.
Click on speedup label box will toggles pause
Scrollwheel for speedup is only active when mouse is over printbed or labels
Support for center format G2/G3 Gcodes (Arc) - Radius format not supported yet
More reslilient against errors and unsupported gcodes
Display extrusion rate (mm/min) in real time
Display pause status in status bar
Display of Fan output changed (III=Full Speed, II=Medium, I=Slow, ""=off)
Rendering bug (Grey spots) fixed

Based on new GCodeInfo
Experimental Edit Mode added
Optimize lavel repaint
Fixed bugs with details toggle and temperature

Some performance improvements.
Window Icon added.
Automatic Zoom on Window resize.
Filedialog uses current user path.
Fixed some multi-threading bugs.

Added Menubar
Show model details by default.
Fixed double buffering bug for MAC OS.
Some Performance improvements

Show current speed and remaining print time.
Fixed double buffering bug.

Render Front and Side View
Experimental Printing support (requires RXTXcomm.jar and /dev/ttyUSB0)
Added S Key-Shortcut for "Start Print"
Some Bug Fixes

Added Mouse Support
Mousewheel = Speed up/down
ALT+Mousewheel = Zoom in/out
Left Button on Bed = Next Layer
ALT+Left Button on Bed = Previous Layer
Right Button = Show Model Details
Left Button on Details = Toggle Model Details
Middle Button = Show Help
Show percentage when loading gcode files
Start with default gcode (GCode Simulator Key Chain) , press f to load file.
Fixed bugs.

Much smoother painting by splitting longer lines into multiple draws
Added nice looking labels with boxes for current infos (instead of plain test string)
Toggle modeldetails can now page through multiple pages of layer details
Unknown keys open about/help dialog.
Fixed acceleration (ignore acceleration for speed distribution), use acceleration for paint and layer time.
Show separate time values (with and without acceleration)

Non-disruptive zoom (no restart) implemented
Jump to previous layer added.
"Next Layer" option completes the layer painting (not skips it)
Paint grid on print bed.

Show new GCodeInfo modeldetails (Material,Weight,Price,.. See GcodeInfo for details.)
Fixed some issues with Skeinforge comments and average calulations.

Support for Java Version 1.6 (MacOS)

Added option (t) to toggle details (show more model & layer details similar to Gcodeinfo)
Added option (f) to open another gcode file.

Handle gcode files with Z-Lifts and negative coordinates (auto center on bed).
Show details of the printed model (e.g. overall print time, size, layers,..)

GCode Simulator for ANDROID available
Allows real 3D printing from an Android device (not just simulation)

All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

It's a helpful when needing to modify gcode. Has issues going back and forth, with direction keys, gcode with comments.

why the program always shows 3mm Filament, i wrote 1.75mm in the gcode ?

The comment in the gcode should look like this:
If you send me your gcode by email I can check why it is not detected.

I will use it when I'm doing my next presentation on "3D printing in the private environment". Many thanks for sharing your work :-)

could we get a way to differentiate between which extruder just printed?

now why the f... would anyone need to see a gcode on android
is there no version for windows ?
this just dont make any sens

the download version is based on Java which runs well under Windows. (read the instructions to the very end)
The Android version allows you to control your 3D printer with a tablet. it basically adds a touchscreen interface to your printer.
Why would anyone not want to have a touchscreen interface for his 3D printer ?

Science is a mystery to man...

Hello! I have gcode in a .txt file. How can i load it in the simulator?

Awesome !!!! It is a wonderfull tool :D

Does not Work with MakerBot x3g Files.

This is wonderful for watching as a simulation of printing a model. It is oddly enthralling for me. Thank you so much for sharing this fabulous software!

what do the colors mean when it is running, does red mean a crash? No documentation anywhere

Each color represents a new layer as it is "printed." This is so you can observe how the layers stack as the simulation runs. It is a good visual way to see how your g-code will perform as the printer uses it.

you are awesome! thank you so much!

Do you provide the source code somewhere (like on github) so that annoying bugs can be fixed?

How can I change the filament diameter from 3mm to 1.75? How can I set the cost for filament also?

Trying to get this to work with my Lasers G-code but it gets stuck after Loading Model reaches 100%. Any idea why?

My laser uses these gcodes:

G21 -Units to mm
G28 -Home
M80 -Turn on Optional Peripherals Board at LMN
M5 -Laser off
G0 -Travel Movement
G01 -Movement+laser on
G02 -Movement+laser on
G03 -Movement+laser on

Could you send me the gcode file by email ? [email protected]

fixed. Please try V132

Thank you! :D

I have downloaded the files and can't get it to work!
In slic3r I put this in the Post-processing scripts->

java -jar D:\Downloads\3Dprinter\GCode_Print_Simulator\GCodeSimulatorV130.jar

After I export the gcode this is the error I get. I don't know what I'm Doing wrong!

"""""the configured post-pocessing script is not executable : check permissions. (java -jar """""D:\Downloads\3Dprinter\GCode_Print_Simulator\GCodeSimulatorV130.jar)

Hi everyone,
I download the files but I don't know how to make it work,I don't see any .exe file is that normal ?
Thanks for your help

this is a java program. You need to have the Java Runtime Environment (jre) installed.
See java.com for downloading java.

Hi, thank's for you help. I install the latest java program but still nothing, is Chrome involve in this ?

Comments deleted.

No, chrome is not involved. Double click on the jar file should open the program.
Or start the java program by calling on the command line
java -jar GCodeSimulator.jar

Which version did you download ?

the V130, I check my default openning program and winrar was open it each time, after choosing Java as the program to use it works !!! Thank you very very much this will help me with my calibration problem on my printer.
By the way do you know any reason why a BCN 3D+ doesn't print good circles ? I just assemble mine and it's a mess on circle and symetric object

Incredible nice program :)
Feature Request: See at which position the extruder is currently at.
I am currently trying to figure out why my extruder moves to fast when using a specific slicing software (must be some wrong setting made by me, but it would help to find the error if i knew where stuff freaks out).
Thanks a lot for this nice piece of software!!!

Comments deleted.

thanks. you can already see the XYZ position below the model details (bottom right) when pause is enabled.

Thanks :)
Can you add the Extruder Position as well?
I have luckily fixed my slicer problem without this feature.
I used CraftWare which produced a gcode that told the printer to expect relative position but the print gcodes were absolute (even on extruder axis), which caused over extrusion and finally made the printfail.

How to configure Linux file manager Nautilus to automatically create thumbnails of GCode files by using GCodeSimulator
See: http://gcodesim.dietzm.de/FAQ.html#nautilus

Will this run a .X3G file from MakerWare? Or am i missing something? I hope its not a ID10T problem!!!

No, It does not work with x3g files.

This is cool. Is it possible for the simulator to play at the w/o acceleration speed? I want the simulation to run alongside a real print, and the w/ acceleration speed is too fast. I tried setting Speedup to 1x but this only makes it run at the w/ acceleration speed. Cheers

can you let the program accept .g file too? rename is a bit painful, ;-)

Is there I way I can tell which toolhead is being used in a dual extruded print?

Yes. Once you have configured an offset for the second extruder (Settings) you will see both nozzles painted. The active one is painted white and the inactive one is painted grey.

Comments deleted.

Before i could get my Printrbot to run correctly from my PC, this program did the trick with a USB adapter for my Samsung Galaxy Tab 2 7.0.
Wonderful program. I plan on using it when I do demos, so I can keep the stuff I haul n the lighter side.

Thank you for putting the time and effort in to this. It's helping me track down a problem that it looks like the slicer software I'm using is causing.... Thank you...

Mega cool piece of software! I am using it now to check for the estimated speeds of my http://quadrap-3d-printer.blogspot.dequadrap-3d-printer.blogspot.de that prints 500mm/sec and the target is to reach 700mm/sec! Bravo for the excellent job!

Thanks !
Wau. 500mm/sec !!! this is cool.

Thanks for adding BfB gcode support in that last release !

My printer is a Rapman from Bitsfrombytes and on these machines the coordinate (X0,Y0) is the middle of the printbed.
It seems that for GcodeSimulator this coordinate is at the bottom-left corner of the screen.
Therefore the simulation occurs in that corner and can't be completely seen.
It could be a good point to be able to tell the program where the origin is with some X and Y offset. Just an idea...
I also know that some Gcode for BfB machines might be different than for other machines.
So maybe it won't be able to completely simulate BfB gcode.

Anyway this seems to be a very great app !
Congrats !

Thanks for the feedback. Could you please send me such a BfB gcode, then I can check how to improve the behavior.
In fact, it should already try to move the 0 position based on the 3d object size, maybe there is a bug in this logic.

it looks really nice from the screenshot and description and I will probably add a "like it" as soon as I will be able to understand how to use it on a Windows PC.
Sorry for being so silly but how do I install and/or launch this app ?
I can't see any .exe or install file (V1.18).
Am I missing something ?
Can someone help me please ?

Cheers !

Could you make the Android version of this load from Google Drive. When I "Load" it gives me the option of picking from the Google Drive but then once I select the file it gives me an error and says the file isn't a valid gcode file. I have a feeling it is not downloading a proper copy of the file to use locally and something in the translation between the Drive app and your app is a miss.

please join the GCode Simulator Google+ community for discussing problems, request features and get news:
I will try to find out what is wrong with Google Drive ....


I wonder if I can control the temperature from the application, because I can only see as increasing the temperature to 220 degrees and I use an ABS that blends well with the 235 º

I do not know English, so this makes Google translation


Si. That is the case. Hopefully soon implement the temperature change, because until then I can not use it with ABS.


Version 1.28 of GCode Simulator & Printer for Android does now support custom temperature presets.
Please join the GCode Simulator Google+ community for discussing problems, request features and get news:

I guess you refer to real printing from an android device running GCode Simulator & Printer ? If yes, the manual temperature control is currently limited to 185,200 and 220 degrees. But I will add a preference panel to configure the temperatures in a follow-up release.

Hi ,what is the optimal configuration for android's tablet ? Processor , RAM, memory ... It s great apps for running your 3d printer

Most important is that the usb-host feature is supported by the tablet. Memory of 512-1024MB is fine. Larger gcode files will require more memory. E.g. a 300000 line gcode requires ~50MB memory. Single core CPU is ok but dual/quad core CPU has some buffer for additional calculations.
I have 2 tablets which run fine: Samsung Galaxy Tab 2 and Trekstor Surftab Breeze 7.0

Wow ... this is great.

Would it be possible to display at the bottom the number of the code-line in the file? And a small editor, where it would be possible to edit the gcode file, to smoothen some details?

Hi, the line number and gcode details are already shown when you hit pause. (in the right bottom corner)
I added the gcode editor to the feature wishlist, but its more complex than it looks like because every change needs to re-analyse the model to calculate things like the time, extrusion,...

Thats great :)

But can i ask you something? In down side on your home page( http://www.dietzm.de/gcodesim/#GCodeSimulatorhttp://www.dietzm.de/gcodesim/... ) you say: "Add GCodeSimulator to the post-processing scripts of your slicer tool (slic3r, Skeinforge) to control the output without manual steps." So :) my question is - how to do this? Please, explain like for some one totally out of software knowledge ;)

Thank you so much :)
That, is for what i'm looking for :)

Hmm does not work with ReplicatorG Files, or does it? Greets

it should work with all Gcode files. Please send me am example file and I can see what the problem is.

Having a similar problem. I sent you an email with 2 example gcode files.

Thank you. The ReplicatorG comment style was not supported. Please retry with the new version v101.

BTW, there's some typos in the interface, where "increase speed" says "ctrl +" while the command is actually "Alt +", etc.

Actually most keys work even without pressing ctrl or alt. Unfortunately Java AWT menu item does not allow to specify plain shortcut keys (without ctrl or alt).

Works well now. Thanks!

Great job ^^
if it can read file .x3g or file .gcode of makerware that is so awesome.

Please send me an example file and I can see if makerware gcodes can make to work.

I must be doing something silly - I try to open a gcode file and the app simply disappears. Any ideas?

Please retry with the new version 0.96. If it still does not work send my your gcode please. Thanks !

Try to run it from a command line to see if it prints out an error. You can also send me ([email protected]) your gcode file so that I can try to reproduce the problem.

Please retry with the new version 0.96. If it still does not work send my your gcode please. Thanks

Please, make new version for android!

I just uploaded the new version to Google Play Store (might take some hours until it is active)

Simply amazing and SOOO helpful when trying to determine if i need to add supports or not

I like the screenshot ;)

This looks like a great tool! The only downside, if you can call it that, is that it uses Java. There's been a load of talk lately about Java being massively insecure and just as I was about to remove it from all my machines, you go and post this. Ho hum. /ClicksDownloadAnyway

I know. I already thought about rewriting this stuff in python to improve my python skills. Not sure if I'll have time to do that.

Had trouble running this, OS X 10.8.2, java version "1.6.0_37"

$ java -jar GCodeSimulator.jar

Exception in thread "main" java.lang.UnsupportedClassVersionError: de/dietzm/GcodeSimulator : Unsupported major.minor version 51.0

Which version of java is this build for? What license have you released this under; is the source code available?


Please try version V0.68

Currently java 1.7 (only because it uses switch() statements with String).
Source code is not yet available, but I might create a github project if there is some demand.

Another vote for Mac..

The new version v0.68 should work with java 1.6. I have replaced the java 1.7 specific statements. Please let me know if it works on MacOS.

Yeah, works like a champ! Thanks!! Would be nice if zooming didn't restart the virtual print, but otherwise no complaints!

I've implemented a non-disruptive zoom in V0.71 (no restart required).