Skip to main content

Immutable 3D print pipeline: arrange, slice, and print

Project description

fabprint

PyPI version CI Python 3.11+ License: Apache 2.0

Immutable 3D print pipeline: arrange parts on a build plate, slice to gcode, and send to a Bambu Lab printer — all defined in a single TOML config file.

fabprint pipeline

Why fabprint?

Code-CAD tools like build123d, OpenSCAD and cadquery let you define physical parts in code — making designs parametric, testable, and version-controlled. But the moment you need to print, that workflow breaks: open a slicer GUI, drag in files, fiddle with settings, hit print. Hard to reproduce, no diffs, the only thing to track are binary project files.

fabprint is aiming to close that gap. Define your objects, filaments, slicer setting and printer targets in a straightforward TOML file. Use a CLI or CI pipeline to arrange, slice and send to the printer. Pin filament and printer profiles to capture the exact settings. Slicing happens in Docker for platform-agnostic reproducible builds. Everything is text, everything goes in git, and the same config produces the same print every time.

Quick start

1. Install

pip install fabprint

2. Create fabprint.toml

[plate]
size = [256, 256]       # build plate dimensions in mm
padding = 5.0

[slicer]
engine = "orca"
printer = "Bambu Lab P1S 0.4 nozzle"
process = "0.20mm Standard @BBL X1C"

[[parts]]
file = "frame.stl"
filament = "Generic PETG-CF @base"

[[parts]]
file = "wheel.stl"
copies = 5
orient = "upright"
filament = "Generic PETG-CF @base"

Parts reference filament profiles by name — no need to manually number AMS slots.

3. Arrange, slice, print

fabprint run fabprint.toml --until plate     # arrange parts onto a build plate
fabprint run fabprint.toml --until slice     # arrange and slice to gcode
fabprint run fabprint.toml                   # arrange, slice and send to printer
fabprint run fabprint.toml --dry-run         # full pipeline without sending to printer

The plate stage also generates a plate_preview.3mf with a bed outline — open it in any 3MF viewer to review placement:

plate preview

Features

  • Multi-format input — STL, 3MF, and STEP files
  • Automatic orientation — flat, upright, side, or custom rotations
  • Bin packing — efficient 2D arrangement with configurable padding
  • Part scaling — uniform scale factor per part
  • Multi-filament — AMS slot assignment per part with correct extruder mapping
  • Slicer integration — OrcaSlicer support
  • Profile management — discover, pin, and override slicer profiles
  • Print delivery — LAN, Bambu Connect, or cloud API
  • Docker support — pre-built images with OrcaSlicer for reproducible CI/CD slicing
  • Cross-platform — macOS, Linux, and Windows

Installation

Requires Python 3.11+.

pip install fabprint

Or with uv:

uv pip install fabprint

Optional extras

pip install "fabprint[lan]"    # LAN printing via MQTT/FTP
pip install "fabprint[cloud]"  # Bambu Cloud API (experimental)
pip install "fabprint[step]"   # STEP file support (build123d)
pip install "fabprint[all]"    # Everything

CLI overview

fabprint uses a single run command with --until and --only flags to control how far the pipeline runs:

fabprint run fabprint.toml                    # full pipeline (arrange → slice → print)
fabprint run fabprint.toml --until plate      # stop after plating
fabprint run fabprint.toml --only slice       # run just the slice stage
fabprint run fabprint.toml --dry-run          # everything except sending to printer
fabprint login                                # log in to Bambu Cloud
fabprint watch                                # live dashboard for all printers
fabprint status                               # query printer status
fabprint profiles list                        # list available slicer profiles
fabprint profiles pin fabprint.toml           # pin profiles for reproducible builds

fabprint watch

See docs/cli.md for the full CLI reference with all flags and options.

See docs/config.md for the complete TOML configuration reference.

Docker

Pre-built images with OrcaSlicer are available on Docker Hub:

docker pull fabprint/fabprint:orca-2.3.1

By default, fabprint uses Docker if available, falling back to a local slicer install:

fabprint run fabprint.toml --until slice                    # Docker first, local fallback
fabprint run fabprint.toml --until slice --local            # Force local slicer
fabprint run fabprint.toml --until slice --docker-version 2.3.1  # Pin Docker image version

For fully reproducible builds, pin both profiles and the OrcaSlicer version in your config:

[slicer]
engine = "orca"
version = "2.3.1"

To build your own image:

./scripts/build-docker.sh 2.3.2          # build only
./scripts/build-docker.sh 2.3.2 --push   # build and push

Platform support

fabprint auto-detects slicer paths per platform:

Platform BambuStudio OrcaSlicer
macOS /Applications/BambuStudio.app/... /Applications/OrcaSlicer.app/...
Linux /usr/bin/bambu-studio /usr/bin/orca-slicer
Windows C:\Program Files\BambuStudio\... C:\Program Files\OrcaSlicer\...

Slicers on PATH are also detected (Flatpak, Snap, custom installs). Profile directories follow platform conventions (~/Library/Application Support/ on macOS, ~/.config/ on Linux, %APPDATA% on Windows).

How it works

  1. Arrange — loads meshes, orients them, and bin-packs onto the build plate
  2. Export — writes a 3MF with per-object extruder metadata for correct AMS slot mapping
  3. Slice — calls OrcaSlicer CLI to produce a Bambu Connect-compatible .gcode.3mf
  4. Post-process — patches the sliced 3MF to fix metadata issues Bambu Connect requires (see docs/gcode-3mf-format.md)
  5. Send — delivers to the printer via LAN, Bambu Connect, or cloud API

Contributing

git clone https://github.com/pzfreo/fabprint.git
cd fabprint
uv sync --extra dev
uv run pytest              # run tests
uv run ruff check src tests     # lint
uv run ruff format src tests    # format

License

Apache 2.0

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

fabprint-0.1.40.tar.gz (6.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabprint-0.1.40-py3-none-any.whl (66.3 kB view details)

Uploaded Python 3

File details

Details for the file fabprint-0.1.40.tar.gz.

File metadata

  • Download URL: fabprint-0.1.40.tar.gz
  • Upload date:
  • Size: 6.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fabprint-0.1.40.tar.gz
Algorithm Hash digest
SHA256 8c73c4625442727095ac69d194efcae71f7f716ec9dd9c72ca2319d22c91e91a
MD5 d689adc15dcd20e259dcacf15e2dbc4d
BLAKE2b-256 1f2c35fbddff40299c18e5bf605415657d97a50a6e2c5239343fbe7a819800b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabprint-0.1.40.tar.gz:

Publisher: publish-cloud-bridge.yml on pzfreo/fabprint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fabprint-0.1.40-py3-none-any.whl.

File metadata

  • Download URL: fabprint-0.1.40-py3-none-any.whl
  • Upload date:
  • Size: 66.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fabprint-0.1.40-py3-none-any.whl
Algorithm Hash digest
SHA256 fa7dbe246489cb3480f6c887dfb2b560a3257c3febaaad825a6410542ebe6776
MD5 977fa4fb779e966da0cab480e048615d
BLAKE2b-256 d5f154d7ce46d8debc14ae8d8cf2acdcbdd0dce462674f2838faf10bb8d13da7

See more details on using hashes here.

Provenance

The following attestation bundles were made for fabprint-0.1.40-py3-none-any.whl:

Publisher: publish-cloud-bridge.yml on pzfreo/fabprint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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