Gears.d3.js is a d3.js example for creating simulated gear animations with SVG.
Here you can see a demo
See the included
index.html for example usage, or see the demo
It's based on this more limited example by mbostock. I improved it by adding a (basic) simulation of the gears, where power is actually trasmitted. The gears also can be dragged around and will automatically mesh correctly when they get close.
Note that the Fractal Gears implementation (as is on my site) is not open source, other than the parts that are in this repo.