Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 2.69 KB

File metadata and controls

34 lines (22 loc) · 2.69 KB

Generating SVGs in Python with vsketch


1. Prep the Virtual Environment

  • Follow instructions from here to install a Python virtual environment, and the very useful SVG optimization and plot-prepping tool, vpype.
  • If you'd like to plot directly from your computer, follow instructions from here to install the AxiDraw command-line interface (CLI), axicli, e.g. python3 -m pip install https://cdn.evilmadscientist.com/dl/ad/public/AxiDraw_API.zip
  • We'll do our Python coding with vsketch, a Processing-like python environment. Use the instructions from here to instructions from here to install it, e.g. pipx install git+https://github.com/abey79/vsketch --system-site-packages
  • Activate the virtual environment with source myVypeEnvironment/bin/activate.
  • Separately download and test the vsketch examples, with e.g. vsk run path/to/vsketch-master/examples/shotter

2. Generate the SVG

  • Instructions are here for creating a new vsketch project, e.g. vsk init svg_lissajous
  • A sample project, svg_lissajous is here. From within the virtual environment, this can be run with vsk run svg_lissajous.
  • This will open up the vsketch visual environment. Note that some variables can be exposed to the interface for interactive control.

3. Additional & More Advanced Examples