G code viewer 3d printer


3/sec Show non-extrusion moves Show retracts and restarts Move model to the center of the grid Show different speeds with different colors Emulate extrusion width Render lines slightly transparent Show +1 layer

GCode analyzer options

These require re-analyzing file:
Sort layers by Z Hide empty layers Show GCode in GCode tab (memory intensive!)

Printer Info

Plastic diameter: Plastic type: ABS PLA Nozzle size: Volumetric E Printer hourly cost: Filament price(per gram):

Error Analysis

Run analysis

Render error analysis results

  • 2D
  • 3D
  • GCode
  • About

gCodeViewer is a visual GCode visualizer, viewer and analyzer in your own browser! It works on any OS in almost any modern browser (chrome, ff, safari 6, opera, ie10 should work too). All you need to do - is drag your *.gcode file to the designated zone.

Current features include:

  • Visualize GCode in 2D, layer by layer
    • Show retracts and restarts
    • Show print/move/retract speeds
    • Display only part of layer, animate sequence of layer printing
    • Show two layers simultaneously so you can check overhangs
    • Adjust line width to simulate print more closely
    • Gcode viewer will try to parse nozzle and filament diameters from gcode, but it may fail to do so. In that case you will need to set it manually in 'Printer Info' tab
  • Analyze GCode
    • Print time, amount of plastic used, layer height, etc. for whole file and for single layer
    • Reference visualized part to GCode file (i.e. select a certain part of 2d visualization, switch to GCode view - it will highlight list of lines responsible for visualized piece)
  • Multiplatform, available online (but works offline too), works locally (doesn't upload you g-code anywhere or download anything but application itself)
  • 3D visualization (I don't know what for, it's dull and useless.. need to rewrite it from scratch)
  • And yeah, it's slow, memory hungry and only supports modern browsers
  • Totally open source so you can use it as you like

All sources are available at https://github.com/hudbrog/gCodeViewer
If you find any bugs or have feature requests - don't hesitate to post them to https://github. com/hudbrog/gCodeViewer/issues
And I would appreciate if you like it on Thingiverse page: http://www.thingiverse.com/thing:35248

PrusaSlicer G-code viewer | Prusa Knowledge Base

Relevant for

:

Plus 1.75 mmMK2.5MK2.5SMK3MK3SMMU1MMU2SSL1MINIMK2SMK3S+MINI+SL1S

Last updated

5 months ago

This article is also available in following languages:

 

Standalone PrusaSlicer G-code Viewer is a lightweight application, which you can use to quickly preview G-codes from all popular slicers. Its behavior is identical to the preview in PrusaSlicer (the same code is used), however, you can load an external G-code file.

Supported slicers

We currently parse, and up to some level interpret, G-code from:

  • PrusaSlicer
  • Slic3r and Slic3rPE
  • CURA
  • ideaMaker
  • Simplify3D
  • Craftware
  • KISSSlicer

PrusaSlicer Standalone G-code Viewer tries hard to estimate the extrusion widths, layer heights, extrusion types, types of moves, layers, etc. from the G-code generated by various slicers. The G-code itself does not contain all the information mentioned above, thus the G-code is usually augmented with slicer specific comments. We try to get as much data as possible, but some parts might still get marked as unknown.

PrusaSlicer version 2.3 and newer augments the G-code with comments ";TYPE:", ";HEIGHT:", ";LAYER_CHANGE", ";COLOR_CHANGE", ";PAUSE_PRINT" and ";CUSTOM_GCODE". G-code generated by older PrusaSlicer which does not contain these new annotations will still be displayed, but the extrusion widths or extrusion types may not be shown reliably.

G-code generated with other slicers will most likely still load correctly, but some features, such as the print time analysis by feature might be unavailable.

Associate with .gcode file extension

If you associate the .gcode file extension with the G-code viewer, you'll be able to launch it simply by opening the file (double-clicking on it or pressing Enter). You can do so by enabling Configuration - Preferences - Associate .gcode files to PrusaSlicer G-code Viewer.

Alternatively, you associate the file extension using your operating system tools.

Windows
  1. Right-click any G-code file
  2. Select Open with - Choose default program...PrusaSlicer G-code Viewer
  3. Click More at the bottom
  4. Tick Always use this app
macOS
  1. Select any G-code file in the Finder and choose File > Get Info
  2. In the Open With section, select PrusaSlicer G-code Viewer
  3. Click Change All and confirm
Ubuntu
  1. Select any G-code file
  2. Right-click the file and select Properties
  3. Select the Open With tab
  4. Select PrusaSlicer G-code Viewer and click Set as default.

The process is similar on other Linux distributions.

Features

The stand-alone G-Code Viewer shows names of used Printer/Print settings/Filament.

Once the final G-code is available after slicing, a new horizontal slider shows up, limiting visualization of extrusions and travel by time thus allowing simulation of the print in time. By default the new horizontal slider limits visualization of the last layer selected by the vertical toolbar. Alternatively the horizontal slider limits the extrusions in all layers selected by the vertical slider. In the first case, if the horizontal slider limits visibility of the top layer, then the other layers below are rendered in a gray color. We borrowed this visualization strategy from the Craftware user interface as Cura did.

The legend newly shows the print time and the print time fraction per feature (perimeter, infill etc.), and the legend labels serve as buttons to show / hide the particular extrusion time. The print time estimate is available in both the G-code preview after slicing and in the stand-alone G-code viewer.

Multiple instances

One can start as many PrusaSlicer G-code Viewers as he wishes either by opening a G-code from the "File->G-code preview" menu, by starting the G-code viewer application, or by double-clicking on a G-code file in a File Explorer/Finder.

How it works

From the technical point of view, the stand-alone G-code viewer is a PrusaSlicer in disguise. The stand-alone G-code viewer is started as a new PrusaSlicer process. The way how the G-code viewer process is started is platform specific:

Windows

The PrusaSlicer.dll contains all the code while the prusa-slicer.exe, prusa-slicer-console.exe and the new prusa-gcodeviewer.exe wrappers just load PrusaSlicer.dll with the proper parameters.

OSX

The application distribution format supports a single binary, which in our case is PrusaSlicer.app/Contents/MacOS/PrusaSlicer. For command-line usage, this binary may be symlinked to prusa-gocdeviewer to start in a G-code viewer mode. Starting new instances of PrusaSlicer does not quite fit the OSX system, as the Finder only expects a single instance of a GUI application to be running. Thus when drag & dropping onto a dock icon of PrusaSlicer resp. G-code viewer, the file is sent to the first instance of PrusaSlicer resp. G-code viewer.

Linux

We support two binary distributions: AppImage and .tar.bz2. The .tar.bz2 format contains a new prusa-gcodeviewer starter script, while the AppImage may be symlinked to prusa-gcodeviewer to start the G-code viewer. The AppImage works by mounting the zipped filesystem image embedded inside the AppImage file and starting the application from there. It is not recommended to start prusa-gcodeviewer from an already mounted AppImage, as the AppImage will be unmounted when the PrusaSlicer that mounted it closes. When the user starts a G-code viewer from an AppImage PrusaSlicer application, another AppImage is mounted by the G-code viewer, which means the PrusaSlicer binary is being loaded into RAM the second time. Therefore if one is low on RAM, it is recommended to use the .tar.bz2 distribution instead of the AppImage until the AppImage is improved to support multiple processes running from a single mounted AppImage.

what are start (initial) commands g code

The current level of development of additive technologies allows users to recreate complex technical objects without a detailed analysis of the essence of the technological process. At the same time, knowledge of G-code and the ability to use it is necessary for every owner of a 3D printer. Effective use of code allows you to dive deeper into the process and take into account all the nuances when printing products. Also, the ability to read and edit the G-code is necessary for the selection of technical parameters when printing and calibrating the device. nine0003

What is a G-code?

G-code is a programming language for machines and machine tools with an integrated numerical control module.

It was developed by the Electronic Industries Alliance in the first half of the 1960s. Programs created using this code have a rigid and extremely consistent structure. G-code lacks cycles, functions, and logical commands; its capabilities allow you to configure the equipment only in such a way that it performs only those actions that were embedded in the computer. nine0003

G-code for 3D printers can be generated by a special program - a slicer - by preloading a 3D model into it and setting the required printing parameters.

G-code is used by the vast majority of popular printers. Its popularity is due to its ease of use and the ability to generate code in any available slicers, including Cura, Chitubox, Simplify3D, Slic3er, etc. You can edit the written program in a regular notepad or NotePad ++, which is available to all users of the Windows operating system. nine0003

But there are cases when printing devices work on encrypted G-code, for example - Zortrax, which uses its own slicer, which generates a file in the Z-code extension.

Files created in this way cannot be opened using standard programs and third-party slicers.

Regardless of the type of encryption, the code consists of lines, each of which is a frame. For each frame or group of frames, developers write comments that are highlighted in the code feed with a semicolon. nine0003

Basic language commands

All basic language commands begin with the letter G. They are responsible for the following actions:

  • Linear and circular movement of the working device along a given trajectory at a set speed.
  • Perform standard operations such as starting fans, heating elements, etc.
  • Set parameters and coordinate system.

Commands whose names begin with M or T are considered additional. M commands are auxiliary, technological. They are responsible for the use of heating, cooling, reading parameters and their subsequent output to the display of the printing device. nine0003

The T commands are responsible for changing the tool used or moving from one extruder to another.

Each line (frame) of the G-code carries an encrypted specific command, as well as a set of characteristics that determines the operation of the equipment: the operating time of the drives, the amount of material supplied, its heating, etc.

Development and popularization of special programs -slicers helped optimize and make the programming process automatic. The code obtained using modern software, as a rule, does not require correction, and if it does, then the developer has to make changes not to the entire code, but to several lines, adjusting one or more parameters. nine0003

How 3D printer software works

Each of the G-code strings is a command that the printing device must execute. The principle of operation of software for 3D printers is to split 3D models into many layers located in a horizontal plane.

Each of them, regardless of the method of creation, further goes through another breakdown into many lines of different thicknesses and widths, the parameters of which are set by the developer.

For example, the line width for a 3D printer using FDM technology must correspond to the diameter of the nozzle, and the height must correspond to the thickness of the extruded material layer.

Each vector in the G-code motion path can be described in terms of the Cartesian coordinate system along which the extruder is moving. Also, this file additionally specifies related parameters: heating, extruder speed, material feed speed, etc.

When to use a G-code? nine0005

Editing a G-code compiled by slicers is useful in the following cases:

  • When making spot edits to the code.
  • For setting special settings, including changing the heating temperature of the extruder during printing, etc.
  • For solving problems. To eliminate them, developers can add a special command, for example, turn on the blower or increase the heating temperature of the material.

G-code commands

The most popular G-codes are:

  • G0 - used to determine the idle speed, does not provide for the operation of the tool.
  • G1 – command defines coordinated movement along X, Y, Z, E axes.
  • G4 - used in cases where it is necessary to designate a pause and set its time in seconds.
  • G28 - the command is responsible for returning the extruder head to the origin of the coordinate system.
  • G90 - is used when it is necessary to use absolute coordinates.
  • G91 is a command used to use relative coordinates. nine0028
  • G92 - determines the current target position.

Commands M

The largest group, including commands responsible for controlling the printing device.

How to edit a G-code?

A wide variety of online and offline programs can be used to edit the G-code. The most popular ones are:

  • Notepad++. This is a free program available for the Windows operating system that allows you to customize G-code syntax highlighting. nine0028
  • gCodeViewer. A cloud-based application optimized for creating commands designed for 3D printers. A specific function of the program is the possibility of layer-by-layer viewing of the product in 2D mode.
  • Simplify3D. A slicer that has its own G-code editor. When using it, the user gets access to the ability to create automatic scripts.

Knowledge of the G-code programming language is necessary for every owner of a 3D printer. By experimenting with manual slicer settings, the user can get any result based on their own experience with a variety of materials. nine0003

  • March 14, 2021
  • 4861

Get expert advice

3D Printing G-code Basics List and Guide

3DPrintStory