- 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
- removed the
browserfield from package.json - changed the
modulefield tomain
- 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)
- api: added
disposemethod 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 🖖
- 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
- 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.
- new option:
minLayerTresholdIf the difference in Z exceeds the threshold a new layer is allocated. If not specified, the default value is 0. (0 meaning a new layer is allocated for each and every increase in Z, however tiny.)
Setting a non-zero value helps to reduce the number of layers that are allocated in memory, which would otherwise cause lagging or even a lock up for spiral vases and such.
Thanks to @raulodev for the initial fix.
This release is all about colors!
- Allow custom colors to be set for:
- extrusion
- travel
- top layer
- last segment
- background
- DEMO
- supports light/dark mode
Colors can be any valid THREE.Color value: css string, color name, hex value, or Color instance.
- Custom non travel moves for CNC'ing
- fixed a bug where the start of the gcode was skipped
- 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.
- G2/G3 arcs are supported thanks to @Sindarius
- .d.ts files are bundled into one: gcode-preview.d.ts
- fix ES module
- expose .controls (OrbitControls) to allow setting autorotate etc.
- (experimental) Add drag 'n drop support
- (experimental) Stream support (for both Fetch and drag n drop )
- Naming & cleanup:
- preview.parser.parseGCode iso now deprecated parseGcode
- Added .init constructor in favor of now deprecated WebGLPreview
- The
targetIdparam is deprecated in favor ofcanvas - the deprecated versions remain working for now
- DEMO:
- Store build volume dimensions in localStorage
- Make loading of large files faster by increasing the chunk size
- Added examples using Fetch API
- Fix bug where the .lines property was overwritten instead of appended to
- Fix bug where the thumbnails was not properly stored
- preserve input gcode, including comments, accessible as
GCodePreview.parser.lines
- parse preview/thumbnail generated by slicer
- improve memory usage by properly disposing of unused geometries and materials.
- properly handle feedrate
- add buildVolume param to render the build volume
- add startLayer, endLayer and singleLayerMode
- remove lineWidth for now
- fix an issue with incremental rendering where the top layer would sometimes not have the correct color
- allow canvas snapshots (to save the image as a file for instance)
- fixed scaling & resizing issues
- support multiple instances
- support lineWidth to render fat lines (known issue: travel is inorrectly rendered as extrusion lines)
- don't reset the layer limit after parsing the gcode
- highlight the top layer and the last segment
- top layer / last segment color is configurable
- clear() method added to reset parser state
- add incremental parsing
- bugfix: only create a new layer when extruding
- allow input to be either a string or an array of strings
- remove 2.5d canvas version
- demo: shows how to use incremental parsing to render a file progressively
- updated demo page
- toggle rendering of travel
- toggle rendering of extrusion
- WebGL rendering with pan/zoom/rotate controls
- added
lineWidthoption (canvas 2.5 D only) - fully typed
- ported to typescript
- added distributable library build in dist folder
- some minor fixes