Releases: xyz-tools/gcode-preview
v2.9.3
Bugfix release
- fixed a bug where the start of the gcode was skipped
v2.9.2
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.
v2.9
G2/G3 Arc support (@Sindarius)
v2.8.2
Bugfix release:
- the vue-demo needed a dependency on threejs to work independently of the parent folder (#41) thx @Zeng95 for the PR!
- the
allowDragNDrop
param was made optional inGCodePreviewOptions
as was originally intended
v2.8.1
changes:
- Remove default imports which resulted in a broken es module
v2.8.0
v2.7.0
Changes:
- (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
- The
targetId
param 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
- Updated to Three.js r144
- three-orbitcontrols or OrbitControls.js no longer necessary
The deprecated module three-orbitcontrols was removed as a dependency in favor of the official jsm version inside the three package. The official jsm module of OrbitControls is now bundled with gcode-preview. This was necessary or order to update to the latest threejs. It also ensures compatibility between threejs/OrbitControls going forward and reduces complexity in the build process.
The dist version of gcode-preview will be slightly larger due to OrbitControls being bundled with it. But the resulting size of any application using gcode-preview should be about the same because OrbitControls still only exists once in the final application bundle.
This also means that the UDM version that can be used in the browser no longer requires OrbitControl.js to be included separately. To update existing html pages that include gcode-preview via a script tag, you can remove the script tag that includes OrbitControls.js
<script src="three.min.js"></script>
<script src="OrbitControls.js"></script>
<script src="dist/gcode-preview.js"></script>
v2.6.1 bugfix
- Fix bug where the .lines property was overwritten instead of appended to
- Fix bug where the thumbnails was not properly stored
V2.6.0 Preserve input
The underlying gcode parser now preserves all input, including comments, as an array property GCodePreview.parser.lines
. This is useful for doing post-processing.
v2.5.0 Slicer thumbnail preview
This release extends the gcode parser to detect and parse thumbnail previews as generated by PrusaSlicer. In the gcode these are found in comments, enclosed between 'thumbnail begin' and 'thumbnail end'. The images are encoded as base64 strings but split over multiple lines. These are now parsed and patched back together, but still kept a base64. This allows easy use in the browser for us as data urls.
The thumbnails can be accessed like this:
gcodePreview.parser.metadata.thumbnails['220x124']
Thumbnails have a .src
property that will create a usable data url from the base64 string.
See an example in the demo source.