/go-pen

Simple generative art framework for pen plotter

Primary LanguageGoMIT LicenseMIT

logo

go-pen is a simple generative art framework for pen plotter. It supports

  • live-reload/preview of plotter programs
  • basic geometries: lines, arcs and bezier curves
  • vector fields, including perlin noise generated ones
  • PNG output
  • SVG output
  • Gcode output

Try it out

Open in Gitpod

Getting started

# install goplot CLI
go install github.com/csweichel/go-pen/cmd/gopen@latest

# create a new sketch
mkdir my-sketches
gopen init my-sketches/hello-world

# start live-preview
gopen preview my-sketches/hello-world/main.go

Generate gcode

All go-pen sketches are self-contained Go programs and can be executed as such. To generate gcode from a sketch just run that sketch:

# print the CLI help
go run example/field/main.go --help

# generate gcode
# Tip: inspecting the gcode is easy with https://icesl.loria.fr/webprinter/
go run example/field/main.go --output field.gcode --device gcode --device-opts example/gcode-opts.json

Notice the --device-opts flag which enables output device configuration. For gcode, this struct defines the available options.