Generative Art via Python

Harry Wang

View the Project on GitHub

About

This tutorial shows how to make generative art using Python and AxiDraw pen plotter.

You should start with axidraw-basics.ipynb notebook, which shows how to setup AxiDraw V3 and use Python to control it to plot a simple SVG.

After that, you can look at voronoi-art.ipynb notebook for a more complicated tutorial on generating art based on Voronoi diagram like:

It’s fun to watch the plotting process. I named my AxiDraw pen plotter “Bohu” after Bohu Tang (1470-1524) - a Chinese painter, calligrapher, and poet of the Ming dynasty period, who is 18 years younger than Leonardo da Vinci (1452-1519).

It looks awesome after framed:

This tutorial is based on the following tutorials:

Setup Inkscape and Axidraw Driver

Please follow the instructions at https://wiki.evilmadscientist.com/Axidraw_Software_Installation and do the followings:

  1. Download and install the latest version of Inkscape for Mac (1.1 tested)
  2. Download and run the latest AxiDraw installer (AxiDraw_Install_Mac_274r1 tested)

Axidraw via Python

You can setup the environment as follows (tested with Python 3.8+)

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

then, jupyter lab to run the notebook axidraw-basics.ipynb to learn how to setup Axidraw and plot a simple SVG image.

Plotting via Inkscape

Once you have the SVG ready, you can follow the steps below to plot it via AxiDraw using Inkscape:

Open Inkscape and choose the paper size - here I choose Letter in landscape (this is related to how to position the paper under AxiDraw):

Screen Shot 2021-07-28 at 9 08 40 AM

Open the SVG:

Screen Shot 2021-07-28 at 9 15 24 AM

Choose AxiDraw Control:

Screen Shot 2021-07-28 at 9 16 37 AM

Setup AxiDraw using “Raise pen, turn off motors” and move the plotting head to the Home position (see your AxiDraw machine - there is a Home):

Screen Shot 2021-07-28 at 9 17 07 AM

Setup the pen using “Pen up” and adjust the pen tip 3mm-6mm above the paper.

Screen Shot 2021-07-28 at 9 17 14 AM

Position the left upper corner of the paper directly underneath the pen tip and start plotting using the Apply button shown below. Note that the plotting will pause if the computer goes to sleep.

Screen Shot 2021-07-28 at 9 31 25 AM