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

Yet Another Gcode Viewer

by jonathanw, published

Yet Another Gcode Viewer by jonathanw Dec 17, 2012

Description

yagv - Yet Another Gcode Viewer

This is a fast 3D Gcode Viewer for Reprap-style 3D printers, in Python and OpenGL (via pyglet)

It was written since I could not find a visualizer that fitted my needs, i.e:

  • Load large files painlessly
  • Let me choose the layer to display
  • Color segments according to function
  • Show a full 3D view for better undertanding of the code.

Designed in Ubuntu Linux; Expected to work in any Linux, Windows or OS X

Full code at https://github.com/jonathanwin/yagv and attached

Requires:

Usage:

yagv [file.gcode]

  • By default, open data/hana_swimsuit_fv_solid_v1.gcode if no file specified

Features:

  • Colors segments according to their type:
    • extruding
    • flying the head to the next extrusion point
    • retracting filament
    • restoring filament
  • Allows displaying layers independently to examine them.
  • Automagically splits the gcode into layers.
  • Automatic scaling to fit the window.
  • Zoom and rotation (Panning planned).

Issues:

  • Panning for close inspection not yet supported.
  • Retract/restore detected but invisible (0-length segments).
  • Designed with Slic3r output in mind, may not support other slicing programs (suggestions/patches welcome).
  • Some gcodes unsupported:
    • G91: Set to Relative Positioning (used by some slicers)
    • G20: Set Units to Inches (usage unknown)
    • Arcs (G2 & G3 ?)

Supplied demo gcode is a slice of http://www.thingiverse.com/thing:5176 (loaded if called with no file)

Since I started this, hudbrog published his very nice GCode Analyzer/Visualizer; check it out: http://www.thingiverse.com/thing:35248

Recent Comments

view all
This is nice in its current state as an easy to launch G-code viewer that doesn't require a browser. I've packaged it for Debian, so it's now apt-get installable in both Debian Unstable and Ubuntu Utopic.
this is really good!
Thanks for your interest :)
You did well to comment, looks like I don't get automatic notifications for new issues.

Contributions are very welcome indeed :)

Relative positioning support would be nice, it should indeed be quite simple. I haven't started on it myself yet.

I have done some improvement on model centering, but haven't released it -- guess I should ;)
I do plan on model moving, but haven't gotten anywhere with that yet. Maybe I (we) need to borrow the (slightly complex) dynamics from Meshlab?

More from 3D Printing

view more

Liked By

view all

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

Instructions

Download and unzip the program.

Install python 2 and pyglet.

Make sure the yagv file is executable, run "./yagv [file.gcode]" Alternatively, setup a symlink to the yagv executable in your PATH, or add the yagv folder to the PATH

Under Windows, you may need to run "python path\to\yagv file.gcode" instead (feedback welcome)

This is nice in its current state as an easy to launch G-code viewer that doesn't require a browser. I've packaged it for Debian, so it's now apt-get installable in both Debian Unstable and Ubuntu Utopic.
this is really good!
Thanks for sharing this program! I just posted an issue on github but I want to post it here too: I love the design of this program and want to contribute, especially to add support for relative positioning (as I have to use this since I have some issues with absolute pos.) Maybe there are other features I can add in the future (I don't see a "move view" feature but maybe I just didn't see it), please let me know if you're still interested in improving this program.
Thanks for your interest :)
You did well to comment, looks like I don't get automatic notifications for new issues.

Contributions are very welcome indeed :)

Relative positioning support would be nice, it should indeed be quite simple. I haven't started on it myself yet.

I have done some improvement on model centering, but haven't released it -- guess I should ;)
I do plan on model moving, but haven't gotten anywhere with that yet. Maybe I (we) need to borrow the (slightly complex) dynamics from Meshlab?
This is the error message(s), using OS X 10.8:

/Users/Reuben/programming/yagv/$ ./yagvTraceback (most recent call last):  File "./yagv", line 12, in <module>    from pyglet.gl import *  File "build/bdist.macosx-10.8-intel/egg/pyglet/gl/http://__init__.py", line 510, in <module>  File "build/bdist.macosx-10.8-intel/egg/pyglet/window/http://__init__.py", line 1669, in <module>  File "build/bdist.macosx-10.8-intel/egg/pyglet/window/carbon/http://__init__.py", line 69, in <module>  File "build/bdist.macosx-10.8-intel/egg/pyglet/http://lib.py", line 90, in load_library  File "build/bdist.macosx-10.8-intel/egg/pyglet/http://lib.py", line 226, in load_framework  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/http://__init__.py", line 431, in LoadLibrary    return self._dlltype(name)  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/http://__init__.py", line 353, in __init__    self._handle = _dlopen(self._name, mode)OSError: dlopen(/System/Library/Frameworks/QuickTime.framework/QuickTime, 6): no suitable image found.  Did find: /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture /System/Library/Frameworks/QuickTime.framework/QuickTime: mach-o, but wrong architecture</module></module></module></module>
Very nice. Works on OS X 10.8 after running: export VERSIONER_PYTHON_PREFER_32_BIT=yes in the terminal.

Great job! I'm looking forward to seeing how your project progresses.
Thanks for the feedback!
What error were you getting before adding this command variable?
WOW. This is awesome!
The fastest, most usable and prettiest stand-alone GCODE viewer I tried so far. I really think you should contact Alessandro from Slic3r to see if he is interested to integrate your work into the Slic3r GUI... Some kind of integrated GCODE visualisation to inspect the code after slicing whould be quite cool, i think..
And please keep up the development - it's worth it :-)
Thanks, glad you like it!
Full integration with Slic3r would not be easy, as it uses a different programming language, but a 'launch yagv' button would be possible.
Integration with Printrun Pronterface would be easier since it is also written in python.

I shall see what I can do :)
How to install this Viewer in the first place?

i got Readme file(not very helping) with a .md ending...
http://gcodeParser.py and yagv file.....
and the data folder with gcode.

what has to move where? on a Mac...?!?
how to tell yagv where it should get pyglet and python?

double click the yagv.. nothing happens
i get the ImportError: No module named pyglet

the only thing i maybe can run is the gcode-parser who will start xcode...
Hi,
Looks like I need to make more user-friendly instructions :)

As of v0.3:
yagv does not need installing, it can be run directly from its decompressed folder.

You will however need to install pyglet manually. Python is probably already installed on Mac & Linux.
Once installed, python & pyglet should need no configuration.

To run yagv, open a terminal in the yagv folder, and run "yagv path/to/your/file.gcode"; or just "yagv", whch will load the demo file.
To just run yagv on the demo file, you can also just double click on yagv (as you did).

If you're getting "ImportError: No module named pyglet", it would seem that pyglet isn't installed properly, but python is.
I expect you downloaded "pyglet-1.1.4.dmg" from here: pyglet.org/download.html ; did you then install it by opening the dmg file and running the mpkg installer?

Cheers
Jonathan
Not familiar with python how would I launch this on windows?
Once python and pyglet are installed, open a terminal(console)
Use 'cd' to navigate into the yagv folder (where yagv, README.md etc. are)
Then run: python yagv "full path to your .gcode file"

Please let me know by Private Message via my profile if you can't get it to work.

I'll try and get something done so you can drag and drop .gcode files straight onto an icon or something in the future.
Top