Skip to main content

Generate gcode to plot on a 3d printer with a pen

Project description

2d plotting on a 3d-printer

This python library generates GCODE from SVG paths, allowing a 3d printer to draw images with a pen. Spirals plotted on Prusa MK3S

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.

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 -o 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 -o example_outline.gcode --fill

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotting3dprinter-1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

plotting3dprinter-1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file plotting3dprinter-1.1.tar.gz.

File metadata

  • Download URL: plotting3dprinter-1.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for plotting3dprinter-1.1.tar.gz
Algorithm Hash digest
SHA256 f9331a4bfedc4039d80ec452f263ede52b90e1912bd828234d3a7ae13277c5aa
MD5 e0bae180393162c0564fa23cf4f2668e
BLAKE2b-256 2baa9aa7bceb4e1b0fcd06995f063ce5209a6b54635a92ae125f10bc553b4a71

See more details on using hashes here.

File details

Details for the file plotting3dprinter-1.1-py3-none-any.whl.

File metadata

  • Download URL: plotting3dprinter-1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for plotting3dprinter-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8052f64920990d18f43fadd846cba21791a3656217c508e8269a37d62717ec04
MD5 2e36393acacb08c16c6fd570e01fa194
BLAKE2b-256 61e525a3dc9ea6d9f552f2c1611d979d3005d529f7a87861d0487cb2fd0b4d40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page