https://github.com/stypox/plotter
All the needed software to print images, text or gcode files on a plotter (a pen that moves along two xy axes)
https://github.com/stypox/plotter
2d-plotter arduino gcode gcode-generation plotter printer
Last synced: 10 months ago
JSON representation
All the needed software to print images, text or gcode files on a plotter (a pen that moves along two xy axes)
- Host: GitHub
- URL: https://github.com/stypox/plotter
- Owner: Stypox
- Created: 2019-12-29T13:00:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-08T15:01:17.000Z (over 3 years ago)
- Last Synced: 2025-03-19T00:06:46.799Z (10 months ago)
- Topics: 2d-plotter, arduino, gcode, gcode-generation, plotter, printer
- Language: Python
- Homepage:
- Size: 73.2 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Plotter software
This repository contains all of the code needed to run a **plotter** and have it print **G-code, text or images**. In particular:
- the `plotter/` subdirectory contains the Arduino sketch
- the `gcode_parser.py` script is able to read G-code, normalize it (so that the printed composition fits on a 2D rectangle of a specified size) and convert it to a shorter binary file
- the `sender.py` script takes the binary file generated by `gcode_parser.py` and sends it to a plotter connected to the computer via a serial port
- the `print.py` script wraps all of the things you may need into a single command
- [text-to-gcode](https://github.com/Stypox/text-to-gcode/) is used to convert some ASCII text to G-code
- [image-to-gcode](https://github.com/Stypox/image-to-gcode/) is used to convert an image to G-code, also with automatic edge detection
# Usage
You can run any script normally with [Python 3](https://www.python.org/downloads/). E.g. for `print.py`:
```
python3 print.py ARGUMENTS...
```
This is the help screen with all valid arguments for `print.py` (obtainable with `python3 print.py --help`):
```
usage: print.py [-h] [-o FILE] [-b FILE] [-l FILE] [--end-home] [-s XxY] [-d FACTOR] [--simulate] [--port PORT] [--baud RATE] {binary,gcode,text} ...
Print something with the connected plotter
optional arguments:
-h, --help show this help message and exit
subcommands:
Format subcommands
{binary,gcode,text}
binary Send binary files directly to the plotter
gcode Print gcode with the plotter
text Print text with the plotter
Output options:
-o FILE, --output FILE
File in which to save the generated gcode (will be ignored if using binary subcommand)
-b FILE, --binary-output FILE
File in which to save the binary data ready to be fed to the plotter
-l FILE, --log FILE File in which to save logs, comments and warnings
Gcode generation options:
--end-home Add a trailing instruction to move to (0,0) instead of just taking the pen up
-s XxY, --size XxY The size of the print area in millimeters (e.g. 192.7x210.3)
-d FACTOR, --dilation FACTOR
Dilation factor to apply (useful to convert mm to steps)
Plotter connectivity options:
--simulate Simulate sending data to the plotter without really opening a connection. Useful with logging enabled to debug the commands sent.
--port PORT, --serial-port PORT
The serial port the plotter is connected to (required unless there is --simulate)
--baud RATE, --baud-rate RATE
The baud rate to use for the connection with the plotter. It has to be equal to the plotter baud rate. (required unless there is --simulate)
```