A friendly fork of github.com/fogleman/axi for personal use.
Go to file
Michael Fogleman 7988548abb Create README.md 2017-01-07 23:21:51 -05:00
axi join paths 2017-01-07 23:07:51 -05:00
examples turtle, util, dragon curve 2017-01-07 22:22:28 -05:00
.gitignore setup.py, rearrange files 2017-01-07 20:48:01 -05:00
LICENSE.md add LICENSE 2017-01-07 23:12:25 -05:00
README.md Create README.md 2017-01-07 23:21:51 -05:00
requirements.txt add requirements.txt 2017-01-07 14:54:51 -05:00
setup.py setup.py, rearrange files 2017-01-07 20:48:01 -05:00

README.md

axi

Python library for working with the AxiDraw v3 pen plotter.

Features

  • control AxiDraw v3 directly from Python
  • constant acceleration (trapezoidal velocity) motion planning
  • path drawing order optimization
  • drawing transformations
    • translate, scale, rotate
    • scale and/or rotate to fit
    • move to origin or center of page
  • "turtle" graphics

TODO / Coming Soon

  • primitives
    • circles, arcs, beziers
  • svg support
  • preview (render png)
  • progress / status while drawing

Installation

axi is not yet available on PyPI, so installation works like this:

git clone https://github.com/fogleman/axi.git
cd axi
pip install -e .

Of course, installing in a virtualenv is always a good idea.

Then you can try the examples...

python examples/dragon_curve.py

Example

Use the turtle to draw a dragon curve, filling an 8.5x11" page.

import axi

def main(iteration):
    turtle = axi.Turtle()
    for i in range(1, 2 ** iteration):
        turtle.forward(1)
        if (((i & -i) << 1) & i) != 0:
            turtle.circle(-1, 90, 36)
        else:
            turtle.circle(1, 90, 36)
    drawing = turtle.drawing.rotate_and_scale_to_fit(11, 8.5, step=90)
    axi.draw(drawing)

if __name__ == '__main__':
    main(12)