Package Exports
- saxi
- saxi/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (saxi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
saxi
make plot good
saxi is a tool for interacting with the AxiDraw drawing machine by Evil Mad Scientist. It comes with an easy-to-use interface, and is exactingly precise.
- automatically scales & centers your drawing to fit on the paper
- minimizes pen-up travel time by reordering & reversing paths
- uses a custom motion planning algorithm (inspired by axi) that's smooth & fast
- automatically splits apart layers based on SVG stroke colors or group IDs
- has a web-based UI, so there's no need to muck around with installing X11 and Inkscape
- can run on a Raspberry Pi or similar, so you don't need to be tethered to your plotter while it plots

Installation
For Raspberry Pi 2 / 3 / 4 / 5
- Install Node.js (if not already installed):
$ curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -
$ sudo apt-get install -y nodejs- Install
saxiglobally:
$ sudo npm install -g saxiIf you encounter an EACCES error when installing the package globally, see Resolving EACCES permissions errors when installing packages globally.
For Raspberry Pi Zero / 1 (armv6l)
The official Node.js builds don’t support armv6l. Use an unofficial build:
- Download and extract Node.js v20 for armv6l:
$ wget https://unofficial-builds.nodejs.org/download/release/v20.5.1/node-v20.5.1-linux-armv6l.tar.xz
$ tar xf node-v*-armv6l.tar.xz
$ export PATH=$PATH:$PWD/node-v*-linux-armv6l/- Install
saxi:
$ npm install -g saxiIf you encounter an EACCES error when installing the package globally, see Resolving EACCES permissions errors when installing packages globally.
Usage
Start the saxi server from the terminal:
$ saxi
Server listening on http://0.0.0.0:9080
Connecting to EBB on /dev/tty.usbmodem1461Then open a web browser:
Go to http://localhost:9080 if you're using the same computer where saxi is running.
Go to http://<computer-ip>:9080 if you're on a different device.
(You can find the IP address by running hostname -I on the computer running saxi.)
Running saxi over SSH
If you're connecting to your Raspberry Pi via SSH, it’s a good idea to keep the saxi server running inside a tmux session so it stays active even if your SSH session disconnects.
Install tmux (if not installed)
$ sudo apt-get install -y tmuxStart a tmux session and run saxi
$ tmux new -s saxi
$ saxiTo detach from the session (leaving it running), press:
Ctrl + b, then dTo reattach later:
$ tmux attach -t saxiTo list sessions:
$ tmux lsTo terminate session:
$ tmux kill-session -t saxiCORS
If you want to connect to saxi from a web page that isn't served by saxi
itself, you'll need to enable
CORS, otherwise
GET/POST requests will be denied by the browser. CORS is disabled by default as
a security precaution, but if you need it it's available. Just launch saxi with
the --enable-cors flag.
Info
saxi makes use of the low-level LM command introduced in EBB firmware version
2.5.3 to carry out highly accurate constant-acceleration motion plans. If your
AxiDraw is running an older version of the firmware, saxi will fall back to the
less-accurate (but still pretty accurate) XM command.
To check what version of the EBB firmware your AxiDraw is running, run saxi --firmware-version:
$ saxi --firmware-version
EBBv13_and_above EB Firmware Version 2.5.3To upgrade your AxiDraw's firmware, see here.
Developing
To work on saxi, you can clone this repo and then run npm start:
$ git clone https://github.com/alexrudd2/saxi
$ cd saxi
$ npm run startThis will not watch local files for changes. If you change the server code, you'll need to restart manually.
Credits
saxi's motion planning algorithm is heavily inspired by Michael Fogleman's axi project.
saxi's UI would be an ugly mess if it weren't for @kylestetz's discerning eye.
Thanks to Evil Mad Scientist for designing and building such a lovely machine!
Made with saxi
These images were plotted by folks using saxi. If you'd like to add something you've made here, shoot me an email!
by Julien Terraz (@targz) |
by Antoine Beyeler (@abey79) |
by Lionel Radisson (@MAKIO135) |
by Daniel Feles (@daniel_feles) |
SVG-IO For AI-Generated Images
Use the SVG IO integration to generate images with AI using a text prompt. Enable it by passing the --svgio-api-key
paremeter when running on the server:
npm run build
node cli.mjs --svgio-api-key <THE API KEY>


