Gcode Preview Versions Save

A simple GCode parser & previewer with 3D printing in mind. Written in Typescript.

v2.15.0

1 month ago

🌈 Multi-color 🌈

  • works via detection of T0-T7 commands
  • supports systems like:
    • Prusa MMU1/2/3 & XL
    • Bambulabs AMS and AMS Lite
    • 3D Chameleon
    • Enraged Rabbit Carrot Feeder (ERCF)
    • IDEX systems
    • Tool change systems
    • Color mixing nozzles when used with a 'virtual tool' (M164 - Save Mix)

Full Changelog: https://github.com/remcoder/gcode-preview/compare/v2.14.0...v2.15.0

v2.14.0

2 months ago

changes:

  • api: added dispose method to stop requestAnimationFrame and free memory
  • fix: Threejs Lighting was updated to use candela as per r155
  • fix: the type for the build volume setting was incorrect, leading to a compilation failure in certain cases

Apart from these changes to the lib, some other changes have been made to the repo, including:

  • generated files were removed from the repo
  • the examples were grouped together
  • the examples received node and security updates
  • linting and type checking was added to the github action (running unit tests were already being run)
  • a roadmap was created in Github to provide some more focus

I want to thank @sophiedeziel for their help in getting a bit more organized, the sparring on Discord and answering issues over the past few months 🖖

https://www.npmjs.com/package/gcode-preview/v/2.14.0

v2.13.0

4 months ago

This is a maintenance release.

  • new options:
  • renderExtrusion
  • renderTravel

These options toggle te rendering of extrusion/travel lines

fixed:

  • fat lines incorrecty rendering lines between extrusion lines
  • [demo] sidebar doesn't update after loading a new gcode file

https://www.npmjs.com/package/gcode-preview/v/2.13.0

v2.12.0

4 months ago
  • new experimental mode: tube rendering In this mode extrusion lines are rendered using volumetric tubes using THREEjs TubeGeometry. Currently this mode is still under development and considered experimental.

To use it, pass the param renderTubes: true

Known issues:

  • performance: rendering takes several seconds or more for large models
  • accuracy: line width and line height are not taken into account when setting the tube radius

Thanks to @sophiedeziel for developing this feature.

https://www.npmjs.com/package/gcode-preview/v/2.12.0

image

v2.11

6 months ago

Vase Mode

Previously, peviewing models sliced in 'spiral vase' mode would suffer lagging or would even lock up. But not anymore, thanks to a fix by @raulodev.

The issue was the creation of a new layer in memory for every increase in Z. Since spiral vase mode causes every gcode command to have a slight increased Z, this could cause hundreds of thousands layers to be allocated. The fix defines a threshold value for creating a new layer. Meaning that gcode commands to be grouped together in a layer until the Z reaches the threshold.

The default threshold is 0.05mm meaning that nothing changes for most gcode files.

To override the default there is a new option: minLayerTreshold.

https://www.npmjs.com/package/gcode-preview/v/2.11.0

v2.10.0

7 months ago

🎃 Halloween release 🎃

image

image

(Halloween Pumpkin by Florian Reppin)

This release is all about colors!

  • Allow custom colors to be set for:
    • extrusion
    • travel
    • top layer
    • last segment
    • background
  • DEMO
    • supports changing colors
    • supports light/dark mode

Colors can be any valid THREE.Color value: css string, color name, hex value, or Color instance.

const preview = new GCodePreview.init({
    canvas: document.querySelector('.gcode-previewer'),
    topLayerColor: 'rgb(0, 255, 255)',
    lastSegmentColor: '#fff',
    extrusionColor: 'rgb(0,255, 128)',
    backgroundColor: 0x101010,
    travelColor: new THREE.Color('lime')
  });

more pictures:

image

(Spider by Jason C Kessler)

image

Ghost by Iain Willis

image

Halloween ghost by Erikringwalters

v2.9.4

10 months ago

This adds an option you can pass to GCode Preview to customize which commands are considered travel moves.

Originally, only commands that had an positive extrusion parameter (ex. G1 E10) are rendered differently from travel moves. But this doesn't work for CNC's. The convention for CNC's is to use G0/G00 for travel moves and cutting moves are done using G1/G2/G3 (or G01/G02/G03).

Here's an example of passing the new param:

 const preview = new GCodePreview.init({
    canvas: document.querySelector('.gcode-previewer'),
    nonTravelMoves: ['g1', 'g01', 'g2', 'g02', 'g3', 'g03']
  });

v2.9.3

1 year ago

Bugfix release

  • fixed a bug where the start of the gcode was skipped

https://www.npmjs.com/package/gcode-preview/v/2.9.3

v2.9.2

1 year ago

This release adds more support for CNC-related instructions like those produced by Mach3. It adds to the G2/G3 support of previous release. Thanks to @RickRyan26 for bringing this to attention.

changes:

  • Some Mach3 compatibility changes:
    • allow g00,g01,g02,g03
    • when g2/g3 are given an r too small to bridge the gap, the radius is automatically set to the minimum needed.
  • Rudimentary support for G20 (inches). It is basically ignored after any movement is done.

Known limitations:

  • G20 commands are ignore once any movement instruction has been processed so it is advised to only use one G20 at the start.
  • Mach3 produces slightly different gcode that this can handle. Notably multiple movement instructions grouped together on a single line is not supported so some preprocessing is still required.

https://www.npmjs.com/package/gcode-preview/v/2.9.2

v2.9.0

1 year ago