Michael Fogleman


Projects tagged "vector"

Hopefully something here will catch your eye.

Table of Contents

AxiDraw January 2017

37 Python Vector Hardware

Unofficial Python library for working with the AxiDraw pen plotter.

The AxiDraw is a very nice modern pen plotter. It ships with Inkscape-based software for controlling it, but I was more interested in programmatically controlling it myself. So I wrote this library that controls the plotter directly over the USB serial port.

The most interesting part of this project, for me, was writing my own motion planning algorithm. I stuck with constant-acceleration for simplicity, and the code for the planner came out to just a couple hundred lines of Python!

See the motion planning algorithm in action in this web-based visualization.


  • control the AxiDraw directly from Python with a simple API
  • convenient command-line utility
  • constant acceleration (trapezoidal velocity) motion planning
  • path drawing order optimization
  • drawing transformations
  • preview drawing (render to png)
  • turtle graphics
  • lindenmayer systems

Primitive September 2016

6,144 Go Objective-C 2D Vector Graphics Optimization

Recreate your photos with vector-based geometric primitives.

You provide an image as input. The app tries to find the most optimal shape that can be drawn to maximize the similarity between the target image and the drawn image. It repeats this process, adding one shape at a time. Using this process, the program can recreate a photo with surprisingly few shapes.

This project was originally inspired by the popular and excellent work of Roger Johansson - Genetic Programming: Evolution of Mona Lisa. Since seeing that article when it was quite new, I've tinkered with this problem here and there over the years. But only now am I satisfied with my results.

The core is written in Go and is open source. A native macOS app is also available in the App Store, providing a nice UI on top of the engine as well as some additional features like "drawing mode." To date, this has been my most successful paid app.

Line Art January 2016

1,958 Go 3D Vector

Rendering engine that produces 2D vector graphics (think SVGs) depicting 3D scenes.

Unlike OpenGL, where the output of the rendering pipeline is a rastered image, the output of ln is a set of 2D vector paths. It supports texturing, CSG, and more! I created this so I could plot 3D drawings with my pen plotter, which naturally requires vector input.