Skip to main content

RasterCarve: Generate G-code to engrave raster images

This is a little Python script I wrote to generate 3-axis toolpaths to engrave raster images.

Installation

pip install rastercarve

Usage

usage: rastercarve [-h] (--width WIDTH | --height HEIGHT) [-f FEED_RATE]
                   [-p PLUNGE_RATE] [--rapid RAPID_RATE] [-z SAFE_Z]
                   [--end-z TRAVERSE_Z] [-d MAX_DEPTH] [-t TOOL_ANGLE]
                   [-a LINE_ANGLE] [-s STEPOVER] [-r LINEAR_RESOLUTION]
                   [--no-line-numbers] [--debug] [-q] [--version]
                   filename

Generate G-code to engrave raster images.

positional arguments:
  filename              input image (any OpenCV-supported format)

optional arguments:
  -h, --help            show this help message and exit
  --debug               print debug messages
  -q                    disable progress and statistics
  --version             show program's version number and exit

output dimensions:
  Exactly one required.

  --width WIDTH         output width (in)
  --height HEIGHT       output height (in)

machine configuration:
  -f FEED_RATE          engraving feed rate (in/min) (default: 100)
  -p PLUNGE_RATE        engraving plunge rate (in/min) (default: 30)
  --rapid RAPID_RATE    rapid traverse rate (for time estimation only)
                        (default: 240)
  -z SAFE_Z             rapid Z traverse height (in) (default: 0.1)
  --end-z TRAVERSE_Z    Z height of final traverse (in) (default: 2)
  -d MAX_DEPTH          maximum engraving depth (in) (default: 0.08)
  -t TOOL_ANGLE         included angle of tool (deg) (default: 30)

engraving parameters:
  -a LINE_ANGLE         angle of grooves from horizontal (deg) (default: 22.5)
  -s STEPOVER           stepover percentage (affects spacing between lines)
                        (default: 110)
  -r LINEAR_RESOLUTION  distance between successive G-code points (in)
                        (default: 0.01)

G-code parameters:
  --no-line-numbers     suppress G-code line numbers (dangerous on ShopBot!)

Defaults are usually safe to leave unchanged.

Examples

rastercarve --width 10 examples/test.png > out.nc

Generate G-code to engrave examples/test.png into an image 10 inches wide. Output will be piped from stdout to out.nc.

Metadata

Release files for rastercarve 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rastercarve 1.0.2
File Size Uploaded Provenance
rastercarve-1.0.2.tar.gz 7.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rastercarve 1.0.2
File Interpreter ABI Platform
rastercarve-1.0.2-py3.8.egg Legacy Egg format - - Details

Total release size: 20.5 kB

Release files / rastercarve-1.0.2.tar.gz

Download URL rastercarve-1.0.2.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f900749bb6f10b5a9f3ca0707a1bb040146e4f5301bd3b8d0b1b21492281c0ad
BLAKE2b-256 checksum
How to use checksums
db4cf0ab9a27084a2cc4526156fa84dc7565c6ad3127804bfee9d1dbe53aacaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

Release files / rastercarve-1.0.2-py3.8.egg

Download URL rastercarve-1.0.2-py3.8.egg
Size 13.3 kB
Tags Egg
SHA-256 checksum
How to use checksums
d5e0db76676610a4631ad6bc7ae8c621be6893daebd16016d1f85990bc1ceaca
BLAKE2b-256 checksum
How to use checksums
e1eee7d2ff29c749564de101867f7a636e7f6226e591027eb989f6e00b852c17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

Security for rastercarve 1.0.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page