GCode Print Simulator

by mdietz, published

GCode Print Simulator by mdietz Jan 24, 2013

Thing Info

45677Views 10730Downloads
Report Thing


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://gcodesim.dietzm.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 V130


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

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

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,..)

Start the java program by calling on the command line (Java 1.6.x required)
java -jar GCodeSimulator.jar

Or Open with java from explorer or your favorite file browser.

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/o=Zoom +/-=Speed n=NextLayer r=Restart p=Pause q=Quit 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 !

Thing Info

45677Views 10730Downloads
Report Thing

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

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 ?

This comment has been 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!!!

This comment has been deleted.
mdietz - in reply to s_s_

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

s_s_ - in reply to mdietz

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.

This comment has been 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!

mdietz - in reply to

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 !

mdietz - in reply to Anar

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


jjolp - in reply to jjolp

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

mdietz - in reply to mana

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 ;)

mdietz - in reply to VSP

I added short description for slic3r here: http://www.dietzm.de/gcodesim/help.htmlhttp://www.dietzm.de/gcodesim/...

VSP - in reply to mdietz

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

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

mdietz - in reply to BNI

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).