There used to be a program called Ars Magna on the Mac back in the '80s that did just that.

Some source code.


Ceci n'est pas un seing.