A simple GCode parser & previewer with 3D printing in mind. Written in Typescript.
Full Changelog: https://github.com/remcoder/gcode-preview/compare/v2.14.0...v2.15.0
changes:
dispose
method to stop requestAnimationFrame and free memoryApart from these changes to the lib, some other changes have been made to the repo, including:
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 🖖
This is a maintenance release.
These options toggle te rendering of extrusion/travel lines
fixed:
To use it, pass the param renderTubes: true
Known issues:
Thanks to @sophiedeziel for developing this feature.
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
.
(Halloween Pumpkin by Florian Reppin)
This release is all about colors!
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:
(Spider by Jason C Kessler)
Ghost by Iain Willis
Halloween ghost by Erikringwalters
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']
});
Bugfix release
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:
Known limitations:
G2/G3 Arc support (@Sindarius)