Created
May 1, 2020 13:05
-
-
Save roboter/3683cd615cefb5b12de186cbe0019a4f to your computer and use it in GitHub Desktop.
OpenSCAD module for simple gears with round teeth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fn = 50; | |
color("yellow") rotate(90-$t*360/15) gear(4, 10); | |
module gear(teeth, step, height=8) { | |
angle = 360/(teeth*2); | |
radius = (step/2) / sin(angle/2); | |
apothem = (step/2) / tan(angle/2); | |
module circles() { | |
for (i = [1:teeth]) | |
rotate(i * angle * 2) translate([radius,0,0]) circle(step/2); | |
} | |
linear_extrude(height) | |
{ | |
difference() { | |
difference() { | |
union() { | |
circle(apothem); | |
circles(); | |
} | |
rotate(angle) circles(); | |
} | |
circle (3); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment