tobychui/SlicerA

New GCode viewer lib

Closed this issue · 5 comments

Hi,

my GCode viewer experiment is quite usable now. aligator/dev#3
Currently I am working on being able to show only parts of the gcode.
For now it supports only basic gcode commands which I also use in GoSlice.

I will export it into an extra js lib. (most likely MIT license)
Then we can use it here.

Now you can try the current state at https://aligator.dev/

Just insert gcode and an example file will be rendered.
You can also use the GoSlice cli with links to stl files. GoSlice is run as Webassembly (slower...) and after that it displays the result in the viewer. E.g.:
goslice https://cdn.thingiverse.com/assets/81/ad/25/a7/b1/Bearing_6000_V02_tolMin.stl (any normal goslice param can be appended...)

I added a slider at the bottom to change the visible layers.

Hi! Very cool terminal and gcode viewer :)
I only got a bit time to check out your gcode viewer this morning and it seems the axis in which it renders to is swapped (Z in 3D printing is up while in three.js it is Y, see the attached image).
2021-05-03_09-40-44

I am not sure if this is a bug or feature 🤔

Let me know when you created a formal repo on the gcode viewer so I can integrate them into the slicer Web UI 👍🏻

It's a bug, should be fixed in the lib :-)
https://github.com/aligator/gcode-viewer

As you don't use npm in SlicerA, you can use the bundled version
https://unpkg.com/gcode-viewer@0.1.5/_bundles/gcode-viewer.js
or the minified one
https://unpkg.com/gcode-viewer@0.1.5/_bundles/gcode-viewer.min.js

(You may put the file directly into the repo, just add a note which version it is, to keep track of it...)

For examples look here:
https://raw.githubusercontent.com/aligator/gcode-viewer/main/example/index.html
https://github.com/aligator/dev/blob/main/src/windows/gcodeViewer.tsx

and also see the documentation in the readme and the comments in the code.

Feel free to create issues if needed :-)

Gcode viewer integrated into SlicerA for standalone mode.
See change log here

2021-05-06_10-45-17

Very cool, will try it out :-)