2d plotting on a 3d-printer
This python library generates GCODE from SVG paths, allowing a 3d printer to draw images with a pen.
Attach a pen to the printer
In order to draw images, we need to attach a pen to the printer. I've used this model to attach a pen to my Mk3S
Install software
pip install plotting3dprinter
obtain SVG file
to generate GCODE a vector-based SVG image file is required. Currently the library only accepts paths made out of lines and splines (cubic and quadratic). Transformed paths and groups are not (yet) supported. The examples folder on this repo contains some compatible SVG files.
Software to generate SVG images from a bitmap image which worked well for me is Potrace.
The vector images generated by potrace need some addititional cleaning up using for example Inkscape. Make sure there are no groups and that the paths use absolute positioning. In settings, under "SVG Output", set "Path string format" to "Absolute". Then select all paths, and go to "Path" and click "Reverse" (This forces inkscape to rewrite the paths) and save as plain SVG.
Attach the pen at the correct height (callibration)
In order to callibrate the height of the pen I've created a small gcode file which just puts the head in the left bottom and moves the head 2mm above the bed. This will be the drawing height (Z).
Put a paper sheet on the bed, and clamp it to the bed using magnets. Run the CALLIBRATE.gcode file and attach the pen such that it just touches the paper.
After callibration run PEN_UP.gcode afterwards to lift the pen back up.
Convert the SVG to GCODE
In order to just plot the contour lines (strokes) present in the svg use:
svgto3dprintplot example.svg example_outline.gcode --stroke
Send the generated gcode file to your printer and enjoy!
Filled shapes
By adding the --fill flag, shapes will be filled with horizontal lines.
svgto3dprintplot example.svg example_outline.gcode --fill
Metadata
Release files for plotting3dprinter 1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| plotting3dprinter-1.12.tar.gz | 9.7 kB | Without provenance | Details for plotting3dprinter-1.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| plotting3dprinter-1.12-py3-none-any.whl | Python 3 | none | any | Details for plotting3dprinter-1.12-py3-none-any.whl |
Total release size: 19.8 kB
Release files / plotting3dprinter-1.12.tar.gz
| Download URL | plotting3dprinter-1.12.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c542a07c4adeb789eddbec8329a1736556533d996f1fd1c2adc9299d19b82b94
|
|
BLAKE2b-256 checksum How to use checksums |
39058cfbf591aa12d558ba285644b1bd9ddcc88b5ddaae1570f05f26f6732f44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / plotting3dprinter-1.12-py3-none-any.whl
| Download URL | plotting3dprinter-1.12-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c56bbec1db61ce4cd17c05e72fad30a6587841d357aaf3d9c5d8c9a901afca3
|
|
BLAKE2b-256 checksum How to use checksums |
0aab237e5fdb1024f367d4b9f60db9f0686f919cdbbe5a9ecbd5f810a23b46c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Security for plotting3dprinter 1.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.