Add support for drawing gears

This adds support for drawing external/internal gears. It's based on http://www.arc.id.au/GearDrawing.html. To make drawings accurate, canvas must be a rectangle (due to known issues), so there is no title, no axes, etc. I tried to use `canvas_width` and `canvas_height`, but that doesn't work at all. Together with PR #630 this could be made into animations.