https://github.com/mic159/benbox-slicer
A raster PNG slicer for the Benbox laser engraver
https://github.com/mic159/benbox-slicer
Last synced: 3 months ago
JSON representation
A raster PNG slicer for the Benbox laser engraver
- Host: GitHub
- URL: https://github.com/mic159/benbox-slicer
- Owner: mic159
- License: mit
- Created: 2015-06-14T03:44:05.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-05-21T09:02:38.000Z (about 9 years ago)
- Last Synced: 2025-03-31T04:33:30.403Z (about 1 year ago)
- Language: Python
- Size: 65.4 KB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Benbox PNG Slicer
=================
Converts PNG raster images into Gcode to be sent to the Benbox Laser Engraver.
Also includes an [OctoPrint](http://octoprint.org/) plugin!
This code was based on Inkscape plugin at [305engineering/Inkscape](https://github.com/305engineering/Inkscape).
Usage
-----
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 to `bw`.
Mode
----
### bw
B/W mode uses a simple threashold if brightness to determine if the pixel should be burnt or not.

### random
Random tries to use little dots to emulate greys.

### greyscale
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?

OctoPrint plugin
================
This also includes a plugin for [OctoPrint](http://octoprint.org/).
To install it, all you have to do is pip install this along with octoprint!
```
pip install octoprint
pip install benbox-slicer
```
Setting up the benbox with OctoPrint
----------
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](https://github.com/foosel/OctoPrint/blob/e722c2f8adef5dce085205977a0e83331aba5837/src/octoprint/util/comm.py#L1524)
to around line 1524 and comment out or delete the code so that it always just uses `_doSendWithoutChecksum`.
For example:
```python
# 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)
```