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



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

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

14136Views 4649Downloads


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: https://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 http://www.pleasantsoftware.com/developer/pleasant3d/
Makerbot's ToolPathViz https://github.com/makerbot/ToolPathViz


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 http://www.sojamo.de/libraries/controlP5/ and peasycam http://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.

All Apps

Upgrade this Thing with Thingiverse Apps

Tools and Utilities

Repair, slice, or enhance this Thing

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

Hi All.
I´ve been trying this code.
But, It does not disappear this error ↓

"ClassCastException: processing.core.PGraphicsJava2D cannot be cast to processing.opengl.PGraphicsOpenGL"

So,Someone help me please...
※ I'm using processing3.3.6

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?  

Says that it can't find javaw.exe

Doesn't work.

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

Cool, though what I was really hoping for was a Gcode viewer that could understand Slic3r's Gcodes: http://slic3r.org/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?

Interesting... I'm also pretty excited about slic3r. I'll look into it.

Ok, I made a "beta" update that does slic3r gcode with layers. The colors are bugged tho.

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?


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!

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.

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

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/whosawhatsis/gcodeExaminerhttps://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.

awesome! good catch, I'll incorporate that.

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.

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.

oop I googled around and found it. I'll try and integrate e codes sometime soon.


Any thoughts on the huge gcode files not loading?

I stronly suspect java runs out of heap space. If you were running it from a .class you could fix this with some vm arguments from the command line. Since your not I'm not really sure.

You could not use Java... Not a very helpful suggestion I know ;)

I just uploaded V3 which I think supports 5d

It does!

Its a beautiful thing. I'm very interesting to see where you take this.

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

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.

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

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?

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?

Or you could just tell me which you want...

I looking for this for so long.

thank you


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

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

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

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.

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)

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.

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

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

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

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?

I've uploaded a new "v2" that incorporates Zh4x0r's panning suggestion. The window size issue is more dicey. I just started coding in processing this week (I use java alot which it's built on) and I currently don't have time to figure out resizing because I'm working on college apps. As an intermediate kludge I just made the window always 5/6 of your screen size.