- A custom printer instruction language
- Real-time printer simulation
- Multiple drawing colors
- Polygon rendering
- Filled polygon support (INFILL)
- Animated print head
- Command parser
- Home positioning
- Imports SVG files
- Converts SVG geometry into printer instructions
- Stroke support
- Polygon infill generation
- Color extraction
- Adjustable scaling
- Adjustable print offsets
| Instruction | Description |
|---|---|
HOME |
Return print head to home position |
MOVE X Y |
Move the print head(800x600 canvas) |
START |
Begin drawing |
END |
Stop drawing |
COLOR R G B |
Change drawing color |
INFILL |
Begin polygon infill operation(printhead speeds up) |
DRAW |
End infill mode(printhead will slow down) |
- Python
- Pygame
- svgelements
- NumPy
- tqdm
Download a compiled version here
git clone https://github.com/thecheetoman/2d-printer-simulator.git
cd 2d-printer-simulatorPython 3.12–3.13 is recommended.
python -m virtualenv venv
# Windows
.\venv\Scripts\activate
# Linux / macOS
source venv/bin/activate
pip install -r requirements.txtLaunch the slicer:
python ./src/slicer/main.pyOr just launch the exe from releases
- Click Load SVG.
- Select an SVG image to import.
- Position the artwork using the X and Y offsets.
- Adjust the scale until the artwork fits within the printer's 800×600 build area.
- Click Slice.
- Wait for the slicing process to finish. Complex SVGs can take a couple of minutes to process.
- Save the generated
.bananafile.
Launch the printer simulator:
python ./src/printer/main.pyOr just launch the exe from releases
- Click the Load button.
- Select the
.bananafile generated by the slicer. - Press Start to simulate a normal print.
- Press Test to perform a high-speed dry run without drawing (useful for verifying toolpaths and movement).
Sometimes the printer may just start printing before randomly stopping, I cannot figure out what is causing that issue, so please relaunch the printer.
shift -> Make printhead transparent(so you can see the rest of your print while it is printing)
t -> Toolpath preview(shows where the printhead is going to go)
SVG Artwork
│
▼
Load into Slicer
│
▼
Adjust Position & Scale
│
▼
Slice
│
▼
Generate .banana File
│
▼
Load into Printer
│
▼
Print Simulation
- The printer's virtual build area is 800 × 600 pixels.
- SVG files generally produce the best results when they contain vector paths rather than embedded raster images.
- Larger or more detailed SVGs will take longer to slice.
- The Test mode is useful for checking print paths without rendering the final drawing.
AI was used to eliminate a few errors in the parser and write some of the slicer.

