Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!


by m6mafia, published

ProcessingGcodeViewer by m6mafia Dec 24, 2011


3/6/2012 Update: I just uploaded a beta of the new version now with centering and initial Slic3r layer support. There still significant issues with this version so I continue to suggest you use v3 unless you need centering or buggy slic3r support.

Hey guys! This is a gcode viewer for makerbot (3D) and 5D gcode written in processing. It's open-source and still a work in progress so if you would like to help out feel free to look at the git: github.com/nmsl1993/ProcessingGcodeViewer. It supports viewing dualextrusion prints colored correctly. Comment with any feature requests you have.

You should probably have a discrete gpu to use this; integrated graphics work but it'll be realllllly slow.

I realized this needed to be done while working at makerbot and listening to Ben Rockhold constantly bragging about pleasant3D (which is OSX-only and closed-source). So I guess he's largely responsible.

Inspirations I had for this:
Pleasant3D pleasantsoftware.com/developer/pleasant3d/
Makerbot's ToolPathViz github.com/makerbot/ToolPathViz

Recent Comments

view all

I was searching such program a lot. I have just found this one and happy.
Programm start fine. I see button  "choose file.." and 3 smal squares. I can see "platform".
But when i load any file all of that what i see - white square. I try your example file - same result. 
I have win7 starter, last jave.
My be program can't fine some libs in my system, but doesn't request anything.
Does Somebody solve this problem?  

I just upgraded to Slic3r 0.7.1 and tried out your beta version. Very nice, both in that Slic3r works much better now and that I can actually inspect it with your app. A couple of minor things: is there a keyboard shortcut to jump up or down one layer? It'd be great if I could step through with the arrow keys. Also, would it be possible to display non-extruder moves in a different color?


The v4 beta is *much* faster! Though the 2D view often blanks out if you try to scrub the layer scrollbar. Nice progress though!

Liked By

view all


ProcessingGcodeViewer by m6mafia is licensed under the GNU - GPL license.

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


To install just download your zip file, unzip, and run the executable.

To be clear, you must unzip the entire archive and keep the executable in its original folder. At least in windows it certainly won't run without the dll's and jars.

P.S. If it does work for you please comment and tell future colleges what a cool dude I am.

If you want to download the source from git and use it yourself here's how:

1. Get the Processing IDE, install libraries controlp5 sojamo.de/libraries/controlP5/ and peasycam mrfeinberg.com/peasycam/
2. Download source from git.
3. Open ProcessingGUI.pde in processing IDE; navigate to Sketch --> Add File and add GcodeViewParse.java and LineSegment.java
4. Run it.


You must be logged in to post a comment.

flygoland on Oct 21, 2012 said:

I was searching such program a lot. I have just found this one and happy.
Programm start fine. I see button  "choose file.." and 3 smal squares. I can see "platform".
But when i load any file all of that what i see - white square. I try your example file - same result. 
I have win7 starter, last jave.
My be program can't fine some libs in my system, but doesn't request anything.
Does Somebody solve this problem?  

ElijahPost on Mar 18, 2012 said:

Says that it can't find javaw.exe

Doesn't work.

m6mafia on Mar 18, 2012 said:

you need to have java installed and add java to your path. Google how to do this.

emmett on Feb 11, 2012 said:

Cool, though what I was really hoping for was a Gcode viewer that could understand Slic3r's Gcodes: http://slic3r.org/

It appears that Pleasant3D and this one as well use some comments (or something?) that skeinforge outputs, but which Slic3r doesn't in order to detect layer changes, etc. Perhaps there is a more generic way?

whosawhatsis on Feb 11, 2012 said:

Mine supports slic3r-generated gcode: https://github.com/whosawhatsi...

meetar on Jan 30, 2012 said:

Beautiful! Works perfectly on both my Mac and PC. Saved me a ton of time and plastic while testing raft and support settings. Thanks, and nice work!

meetar on Mar 25, 2012 said:

After lots of use: doesn't work reliably on larger files in XP - often only displays a white screen. Quitting/restarting a few times works, but is tedious.

whosawhatsis on Dec 28, 2011 said:

Have you noticed that everything is backwards? That's because Processing has a left-handed coordinate system. The Y axis is reversed as a vestigial feature of Processing's origin in 2D graphics. I discovered this while working on my own gcode visualizer in Procssing: https://github.com/whosawhatsi...

Here's the line I added to mine to fixes this problem:
scale(1, -1, 1); // Right-handed coordinate system, please. Thank you.

m6mafia on Dec 28, 2011 said:

awesome! good catch, I'll incorporate that.

TheRuttmeister on Dec 28, 2011 said:

Core functionality works just fine. And runs nicely too. Although its having trouble with the huge Gcode file I keep trying to load into it (

Correct visualisation of 5D Gcode would be great!
5D defines extrusion by giving E commands, the E axis being the extruder. So E moves defines the length of feedstock pushed into the extruder. You might need to add a setting to define 1.75 or 3mm filament.

m6mafia on Dec 28, 2011 said:

sorry, this obviously reveals my huge noobishness with non makerbot stuff but how can I generate soem 5d gcode with skeinforge. I need to be looking at a file to do the regex for the viewer.

TheRuttmeister on Dec 28, 2011 said:

Oh and I'm running Win7x64. Unzipped and it worked first time. :)

whosawhatsis on Dec 26, 2011 said:

I managed to get it to work under Lion by manually launching the 64-bit application stub (the 32-bit one hangs when trying to load a file, apparently in the P5 library code). I haven't yet found a way to get it to default to the 64-bit version when clicking the application icon.

PieterBos on Dec 26, 2011 said:

Nice work on my Mac 10.6.8 unzip and launch .... np

JelleAtProtospace on Dec 26, 2011 said:

Nice, but I could not see anything with the first gcode I grabbed. I had a look at some of the code, and I think that is because you are relying on (ancient!) M101 and M103 to signal if the extruder is on. That excludes any 5D gcode where there is an extra E coordinate that determines how much plastic the extruder extrudes.

Not all 3D printers use a geared extruder/M codes for extrusion, and not all gcode is meant for 3D printers. The vast majority is for milling machines of all kinds. Could you make your code more generic that it accommodates those uses too?

m6mafia on Dec 26, 2011 said:

For sure, I don't really know the codes other than those that the makerbot firmware uses. Is there any resource you could point me to where I could check out which codes to implement for 5D?

hugoelec on Dec 25, 2011 said:

I looking for this for so long.

thank you

yzorg on Dec 25, 2011 said:


i want to test this.. im on an Mac. but since i am a complete noob about using processing or Terminal i just dont get it to run..

i just cant do what the readme sais.. what am i doing wrong?!?
I wrote in caps what i think is my missing cogwheel...
i dont know how to do that -
gt; "FROM THIS DIRECTORY type the following.."

Readme sais:
"To fix this, use the Terminal on Mac OS X, and from this directory, type the following:"
chmod +x ProcessingGcodeViewer.app/Contents/MacOS/JavaApplicationStub

this is what i get answered when i push enter to confirm in the terminal:
bash: /Users/Desktop/ProcessingGcodeViewerv2OSX/ap
plication.macosx/ProcessingGcodeViewer.app: is a directory

m6mafia on Dec 25, 2011 said:

Ok so this is a huge kludge since I don't use OSX, but I suspect you could recursively chmod (change permissions) the entire directory. That would look like : chmod -xR /Users/Desktop/ProcessingGcodeViewerv2OSX/application.macosx/ProcessingGcodeViewer.app

dahpprince on Dec 25, 2011 said:

This is incredible! Works well on Win 7 x64. Any college would be out of their mind not to take you.

whosawhatsis on Dec 25, 2011 said:

Not working for me on OS X (Lion).

BTW, you might want to list the dependencies somewhere. Tracking down the libraries based on error messages was a bit annoying, especially considering how ungoogleable "processing" is.

m6mafia on Dec 25, 2011 said:

the two libraries I used were controlP5 and peasycam, they should be included in the built file though. I'm curious whether all mac users had errors (I don't own a mac so cant test)

m6mafia on Dec 25, 2011 said:

I was getting some feedback that the win32 version was not working for some win64 people, I'm uploading the win64 version that the processing ide built. I suggest trying the win32 version first, even on win64 machines. I have never observed the win64 version to work but just in case here it is.

m6mafia on Dec 25, 2011 said:

Nope win64 build just never works. Windows x64 users should use the win32 version if possible.

aubenc on Dec 24, 2011 said:

WOW!! This is SO awesome !! Thank you!

Looks like the window is set to a fixed size (?)

Zh4x0r on Dec 24, 2011 said:

Agreed, absolutely awesome, but window size change would be a really useful addition, as would automatic centering of parts based on the Gcode mins and maxes.

I have some parts that I print at the corners of the build platform instead of at the center, and I can't see parts of them when it's in 2D mode, so maybe make it possible to move the 2D mode view in the xy plane?