- A visitor presses the countdown button
- The button is wired to a Arduino, which sends a keyboard shortcut to the mac.
- The shortcut triggers the Photo Booth countdown.
- A picture is taken
- After a couple of seconds the picture is copied to a source folder.
- An operator presses the plot button
- The button is wired to a Arduino, which sends a keystroke to the mac.
- On the mac, there is a terminal process running, which waits for a certain keystroke.
- When the the 'plot' command is received, a series of scripts are executed:
- The oldest picture in the queue gets selected
- The picture is cropped to a postcard-ratio, taking the position of one ore more faces into account. smartcrop
- A Python script then transforms the cropped picture into a line drawing (SVG) linedraw
- The SVG gets simplified and optimized for plotting with vpype
- The optimized SVG is then plotted with the AxiDraw
- Finally, the original pictures gets deleted to clean up the queue.
The plotter script has a couple of options:
p
- Plots the oldest picture in the queue.
l
- Lists all the pictures in the queue with their timestamp.
t
- Toggles the plotter pen in its up or down position. Useful when mounting the pen.
d
- Disengages the plotter motors. This way you can move the plotter head freely.
c
- Draws a "calibration" picture.
q
- Stops the script.
- Make sure that all the cables are connected to the computer. Seems obvious, but we've all made that mistake once before, right?
- Open Photo Booth on the extra screen, open this project in VS code on the operator screen.
- Now start the script by running
npm start
in the terminal
download and unzip in project directory
Yeah, good luck with this one...
python3 -m venv env
python -m pip install https://cdn.evilmadscientist.com/dl/ad/public/AxiDraw_API.zip
pip install opencv-python
pip install Pillow
pip install vpype
pip install rembg
PIP/Pillow issues?
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
vpype on M1 https://vpype.readthedocs.io/en/latest/install.html#installing-using-pipx-apple-silicon-m1
npm i -g zx
The Swiss-Army-knife command-line tool for plotter vector graphics. stable release
https://github.com/danielgatis/rembg
https://axidraw.com/doc/cli_api/
- The terminal running the plotter script, needs to be in focus to receive the keyboard input that the Arduino sends.