A Python interface to a large-format pen plotter
The command and HPGL Classes
Two other important classes are not printed with this article but are available for download from the Raspberry Pi Geek FTP site [5].
The command
class doesn't have any functions, just variables. An instance of the command
class is instantiated for every command in every HPGL file that gets loaded. This way, I can refer to commands and arguments with meaningful subscripts rather than numerical indexes or slice notation everywhere else.
The HPGL
class represents an HPGL file. Each command is represented as an instance of the command
class. All of the shift, flip, and visual commands are implemented in the HPGL class.
Conclusion
Although a pen plotter might not be on your list of items to procure, it does provide an interesting glimpse into the history of paper output devices. Because these devices share a very similar operating principal with CNC machines (selecting tools, moving physical media), they are a great training tool before moving on to machines involving wood and metal.
Even though you're limited to lines in just a few colors, that doesn't mean you can't color in areas by hand later. Here's the finished poster after it was fully inked by one of my friends (Figure 7).
Infos
- HP DraftPro 7570: http://www.hpmuseum.net/display_item.php?hw=392
- CNC machines: http://en.wikipedia.org/wiki/Numerical_control
- Inkscape: http://inkscape.org
- HPGL reference: http://cstep.luberth.com/HPGL.pdf
- Download listings: ftp://ftp.linux-magazine.com/pub/listings/raspberry-pi-geek.com/11
Buy this article as PDF
(incl. VAT)