Releases: xyz-tools/gcode-preview
v3.0.0.alpha.3
This is the 3rd alpha release for v3.
This started as a big refactor, cleanup and (breaking) API improvement. Still WIP and unstable.
Although we're now at 30+ open tickets, way more than half a year ago, the path towards v3 is much clearer now. We're mostly fixing bugs and finetuning.
Stay tuned!
What's Changed since v2.18
- Feature/cleanup demo by @remcoder in #187
- fix dev gui breaking when build volume is not set by @remcoder in #190
- Disable tube width when tube rendering is disabled by @remcoder in #192
- Remove the experimental label from tube rendering by @remcoder in #191
- Update eslint config by @remcoder in #197
- Bump vite from 5.3.1 to 5.4.6 by @dependabot in #205
- Bump dev deps & speed up build by @remcoder in #207
- Migrate demo to vuejs by @remcoder in #195
- Improve dev build by @remcoder in #210
- Upgrade to Threejs r169 by @remcoder in #213
- Run actions on v3.x branch by @sophiedeziel in #217
- Extract out BuildVolume by @sophiedeziel in #188
- Fix the initial render logic of the demo by @sophiedeziel in #215
- Quick fix removes light mode for now by @remcoder in #226
- Fix thick lines and set min width to 1 by @remcoder in #237
- v3 temporary branch by @sophiedeziel in #225
- Re-render on build volume change by @sophiedeziel in #245
- Move examples to standalone repos by @remcoder in #251
- Bump happy-dom from 13.10.1 to 15.10.2 by @dependabot in #248
- Disable preserveDrawingBuffer by @remcoder in #255
- Fix drag and drop by @remcoder in #256
- Bump cross-spawn from 7.0.3 to 7.0.6 by @dependabot in #252
- Bump nanoid from 3.3.7 to 3.3.8 by @dependabot in #260
- Release 3.0.0-alpha.1 by @remcoder in #259
- Demo/logrocket by @remcoder in #261
- Demo/logrocket by @remcoder in #262
- Cleanup deprecated api's by @remcoder in #265
- Fix Node 22 compatibility by @remcoder in #266
- Fix toggle single layer by @remcoder in #267
- Add attribution to gcode models by @remcoder in #274
- Add tsdocs for everything and improve typings for readability by @remcoder in #270
- Update color instantly by @remcoder in #275
- Bump vite from 5.4.6 to 5.4.14 by @dependabot in #279
- Fix: disable clipping when min/max layer not set by @remcoder in #283
- Set a default value for lineHeight by @remcoder in #286
Full Changelog: v2.18.0...v3.0.0.alpha.3
v2.18.0 - Summer Time
2.18.0 🏖️ Summer time 🏖️
Features
- performance: Tube rendering is now more performant due to the use of BatchedMesh. This results in higher frame rates especially for larger models. (requires Threejs v0.159+) by @sophiedeziel in #164
- Introduce Dev mode by @sophiedeziel in #157
This uses lil-gui to add a panel with some debug stats and toggles. For instance, it allows you so see the wireframe of the model.
Bugs & small updates
- Bump braces from 3.0.2 to 3.0.3 in /examples/vue-demo by @dependabot in #167
- Fix slowdown in progressive render by @remcoder in #136
Docs & typing
- Documentation by @sophiedeziel in #166
- Feature/mark methods as internal by @remcoder in #173
- Export type GCodePreviewOptions by @remcoder in #175
Demo
- Upgrade to Threejs v0.159 and use module imports by @sophiedeziel in #158
- Fix/stats counter position by @remcoder in #182
Full Changelog: v2.17.0...v2.18
v2.17.0 🚀 Extrusion geometry 🚀
What's Changed
- performance: Tube rendering is now faster and more accurate, thanks to a new custom geometry
- feature: The parser can calculate layer height for each layer. It is used in tube rendering as the line height of extrusions
- options: New option
lineHeight
, that overrides the height of all extrusion lines in tube rendering
The repo also got some improvements:
- Automatic deploy of the demo when pull-requests are opened and merged
Pull requests
- Add autodeploy action by @remcoder in #155
- ExtrusionGeometry: use a custom geometry for extrusions by @sophiedeziel in #149
- Fix readonly type by @sophiedeziel in #160
- Layer height by @sophiedeziel in #161
- Fix the PR deploy to run on the PR and not the PR target by @sophiedeziel in #162
- Fix github actions to run on the pr branch by @sophiedeziel in #163
Full Changelog: v2.16.0...v2.17.0
v2.16.0
What's Changed
- Fixed package being loaded by react(-scripts) by @remcoder in #151
- Add presets to the demo by @sophiedeziel in #145
- Tube's diameter set by an Extrusion Width parameter by @sophiedeziel in #147
- Allow spaces in gcode params by @remcoder in #143
Full Changelog: v2.15.0...v2.16.0
v2.15
🌈 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: v2.14.0...v2.15.0
v2.14
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 🖖
v2.13
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
v2.12 Tubular 🤙
- 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

v2.11 🏺 Vase Mode 🏺
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
.
v2.10 Halloween: Colors
🎃 Halloween release 🎃

(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:

(Spider by Jason C Kessler)

Ghost by Iain Willis

Halloween ghost by Erikringwalters