cad.py is a single-file script by Neil Gershenfeld, capable of creating GCode files for isolation milling and drilling.
Here it has been modified so as to work with Makerbot Unicorn pen plotting, solenoids for lifting a pen or turning a laser on/off and in its original state. The output Gcodes have also been modified to work with more up to date reprap style firmware and hosts.
All credit for cad.py goes to the original creator Neil Gershenfeld of MIT Center for Bits and Atoms and David Carr of Make Your Bot who optimised the code that is in use here.
very good project, thanks!