diagrams / diagrams-contrib

User-contributed extensions to diagrams
BSD 3-Clause "New" or "Revised" License
27 stars 30 forks source link

Spirograph module #3

Open fryguybob opened 12 years ago

fryguybob commented 12 years ago

(Imported from http://code.google.com/p/diagrams/issues/detail?id=85. Original issue from byor...@gmail.com on July 17, 2012, 04:03:01 PM UTC)

It would be fun to have a module to generate Spirograph images. The basic idea would be to generate a discrete set of points lying on a cycloid, epicycloid, or whatever, and then use them to create a cubic spline.

fryguybob commented 12 years ago

(Imported. Original comment by fryguy...@gmail.com on July 17, 2012, 08:40:21 PM UTC)

For the case of circles or ellipses inside circles it should be straight forward to represent the resulting motion of the pen by building up transformations relative to the point of contact between the inner and outer shapes. As the shapes move, the new relative position depends on the distance along the surface. For non-circle shapes, specifically ones with sharp points, there is extra motion where the point of contact hits the cusp and the inner part can now move freely. Piecewise these should all be nice continuous motions that can be expressed with a single transformation, so I think we can come up with something that composes really nicely.

byorgey commented 11 years ago

http://press.princeton.edu/books/maor/chapter_7.pdf may be helpful.