Is it possible to extrude along a curved path like those made by a spirograph?

I was looking at spirograph drawings and I was wondering if Blender has any way of extruding along such a path so that it could be turned into a mesh object. Here's a link to some spirograph pictures: https://www.google.com/search?q=spirograph&num=100&safe=off&rlz=1C5CHFA_enUS511US512&espv=210&es_sm=119&source=lnms&tbm=isch&sa=X&ei=_aonU9OiH8PlyAHgxYBw&ved=0CAoQ_AUoAg&biw=1076&bih=603

I assume you would need to know the mathematical formula for the curve?

You can also use an Array modifier to create a basic design: You could take a final image and trace it in blender, like you would with say a logo. You could also use a python script to create the curves for you, either mathematically or from a preset list of coordinates.

To make the curve visible you can either increase the bevel depth and resolution or use another curve to define the shape of the curve.

If you wanted to animate the spirals being drawn this question would help

Might not do what you want but as a starting point there is an addon called "Add Curve: Extra Objects" that does some spirals and torus knots. Try the cycloid type from curves galore.

You might be able to use this stackexchange answer to draw the curve from an equation: Generate curve from equation

You can use the math for spirographs from wikipedia for example: http://en.wikipedia.org/wiki/Spirograph#Mathematical_basis

Or google for some formulas for interesting spirographs.

As mentioned above, a python script would be one way. The mathematical shape is a hypotrochoid. The formula(see wikipedia)is dependent on two radius and a diameter, but provides a stunning variety of designs. The easiest method would probably be to create a curve, then add depth and an extrusion shape (here's an example of how), and then convert to a mesh.