Quote:
// CA's mini gears
$fn=100;
nt=8; // number of teeth
tt=1.2; // width of gear teeth
lt=1.5; // length of gear teeth
gd=6; // overall gear diameter
gt=1; // gear thickness
ch=1; // centre hole size
ns=100; // sides in central hole - 6 for hex fitting, 100 for round
difference() {
cylinder(d=gd-lt*1.5,h=gt);
cylinder(d=ch,h=gt,$fn=ns);
} // end diff
difference() {
for(r=[1:nt]) {
rotate([0,0,(360/nt)*r]) translate([0,lt,gt/2]) cube([tt,lt,gt],center=true);
}
cylinder(d=ch,h=gt,$fn=ns);
} // end difference
Copy and paste everything in the quote window into openscad and press f5 to see a quick render and f6 to render for export. Can be exported as .stl, off, amf, dxg etc