Skip to content

Releases: xyz-tools/gcode-preview

v2.9.3

26 Feb 23:36
Compare
Choose a tag to compare

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

24 Feb 20:08
Compare
Choose a tag to compare

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

15 Jan 21:58
Compare
Choose a tag to compare

v2.8.2

04 Oct 18:35
Compare
Choose a tag to compare

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 in GCodePreviewOptions as was originally intended

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

v2.8.1

01 Oct 19:10
Compare
Choose a tag to compare

changes:

  • Remove default imports which resulted in a broken es module

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

v2.8.0

01 Oct 13:18
Compare
Choose a tag to compare
  • expose .controls (OrbitControls) to allow setting autorotate etc. (fixes #37)

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

v2.7.0

21 Sep 11:04
Compare
Choose a tag to compare

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 of canvas
    • 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

23 Oct 08:17
Compare
Choose a tag to compare
  • 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

11 Oct 17:08
Compare
Choose a tag to compare

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

14 Sep 20:39
Compare
Choose a tag to compare

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.

image

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.