Converts PNG raster images into Gcode to be sent to the Benbox Laser Engraver.
Also includes an OctoPrint plugin!
This code was based on Inkscape plugin at 305engineering/Inkscape.
Basic usage looks like this:
benbox-slicer --input test.png
The results will be in a file called output.gcode
in the current directory.
Other options:
--speed
The speed to make the laser go while its on. Defaults to 200.--resolution
Lines per mm. 10 works best with the benbox. Defaults to 10.--mode
Mode of converting from the PNG to the laser. See below. Defaults tobw
.
B/W mode uses a simple threashold if brightness to determine if the pixel should be burnt or not.
Random tries to use little dots to emulate greys.
This mode attempts to use the laser's intensity to draw different tones of grey.
It is experimental, and doesnt seem to work all that well for me yet, but why not give it a go?
This also includes a plugin for OctoPrint.
To install it, all you have to do is pip install this along with octoprint!
pip install octoprint
pip install benbox-slicer
Currently the benbox does not work out of the box with OctoPrint :(
The benbox does not support checksums in GCODE, and you will have to modify the source code to make it work.
Open up octoprint/util/comm.py
to around line 1524 and comment out or delete the code so that it always just uses _doSendWithoutChecksum
.
For example:
# now comes the part where we increase line numbers and send stuff - no turning back now
#if (gcode is not None or self._sendChecksumWithUnknownCommands) and (self.isPrinting() or self._alwaysSendChecksum):
# linenumber = self._currentLine
# self._addToLastLines(command)
# self._currentLine += 1
# self._doSendWithChecksum(command, linenumber)
#else:
self._doSendWithoutChecksum(command)