Alorithmic LEGO(r) Technic compatible gear generator. The picture (from gear-27.stl) is an example of gears-v3.scad, a greatly improved adaptation of bjepson's gear.scad with all code included, round holes, and automatic parameter selection.
Greatly improved LEGO(r) Technic gear generator. It now makes actual round holes (not nonagons) and automatically picks the hole parameters for you. More importantly you don't have to download any missing pieces elsewhere, all the code is included. "gear-v3.scad" is the best version.
On Jan 6th, I fixed a glitch illustrated by the JPG image (see thingiverse.com/image:224135 ). This was an error in the original MCAD gear module. The problem shows up in gears with a small number of teeth; "gear-v2.scad" is the old version, if you want to see the difference for yourself.
To use: Load gears-v3.scad into OpenSCAD and change "10" in the line "myGear(10);" to whatever number of teeth you want your gear to have. "gear-27.stl" is sample output.