Images programmatically drawn and animated in canvas.
Uses the canvas drawing API to make the cogs, captures the result as an image which is the final object to be rotated.
I have taken this approach as image manipulation is (surely!) more performative than rotating the set of points that describe each cogs and redrawing via the API.
Teeth meshing is a (currently poor) illusion, rather than physics based.
Each cog uses a constructor object which defines the following properties:
In addition each cog uses / calulates the following: