Generating pen plotter art

A pen plotter is a computer output device that can draw with a pen (or a brush, marker, etc) on a paper. Some such devices move the pen in the X and Y axes, while others can move the paper instead.

Pen plotters were introduced in the 1950s and 60s and have become popular among artists since the mid 2000s.

Unlike other output devices like ink-jet and laser printers which accept pixels, pen plotters must be fed with vector data: lines and curves.

OPENRNDR provides a rich toolset to generate and manipulate vector data.

SVG vs g-code

There are two main file formats used to send designs to pen plotters:

  • SVG (Scalable Vector Graphics), used with newer devices like the AxiDraw.
  • g-code, often supported by older plotters, CNC devices and laser cutters.

OPENRNDR can easily load, manipulate, generate and save SVG files. There is a non-yet-merged contribution to add g-code support.

The following sections focus on SVG.

Hello world

This is one of the simplest programs we can write to produce an SVG file containing just a circle.

fun main() = application {
    program {
        val design = drawComposition {
            circle(drawer.bounds.center, 200.0)
        }
        design.saveToFile(File("data/design.svg"))
    }
}

The API in the composition drawer is almost identical to the one of the standard drawer: we can use methods like segment, contour, shape, circle, rectangle, etc.

Find more tips on using OPENRNDR with pen plotters in the forum.

edit on GitHub