p5.fab is a p5.js library for digital fabrication. It helps you programmatically author toolpaths for low-level control over your machine!
full documentation is found on the p5.fab wiki and the source code is on github. The development of p5.fab was guided by studies of 3D printer maintenance and evaluated with creative code artists; you can read about that in our paper, if you're interested!