[cairo] curve Does Maurer
ldo at geek-central.gen.nz
Sun May 29 23:19:28 UTC 2016
curve <https://github.com/ldo/curve> is a program I wrote a couple of
years ago to entertain kids at a local community centre. (Let kids use
the command line? Oh the humanity...) It can draw its curves in a
number of different ways: on-screen using turtle graphics, to a PNG
file with Cairo, or to a PostScript file.
The kinds of curves it can draw are trochoids (“Spirograph”),
Lissajous (as seen on innumerable science-fiction film and TV shows of
the 1960s and 1970s) and rose curves. I added an offset parameter to
the rose curves, to bring even more variety to their shapes
(particularly useful in the degenerate cases where otherwise the same
curve would be traced twice). It can draw multiple curves on top of each
other, just by giving multiple curve specifications.
More recently, I discovered Maurer roses, originally described in an
article from 1987
Unlike the other curve types, these are not approximated by
straight-line segments, they are explicitly constructed out of a
specific number of straight lines. So I had to do some tweaks
to my curve-rendering machinery to accommodate them.
So far I believe I am able to reproduce all the examples from Maurer’s
More information about the cairo