Skip to content

Instantly share code, notes, and snippets.

@roboter
Created May 1, 2020 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roboter/3683cd615cefb5b12de186cbe0019a4f to your computer and use it in GitHub Desktop.
Save roboter/3683cd615cefb5b12de186cbe0019a4f to your computer and use it in GitHub Desktop.
OpenSCAD module for simple gears with round teeth
$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