Skip to content

Instantly share code, notes, and snippets.

@kelliott121
Created July 23, 2016 22:58
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 kelliott121/0db350204117dc465b9547ab1351d48e to your computer and use it in GitHub Desktop.
Save kelliott121/0db350204117dc465b9547ab1351d48e to your computer and use it in GitHub Desktop.
module gear(num_teeth)
{
num_slices = 20;
//rotate_angle = ((360 / num_teeth) / 2);
rotate_angle = 0;
union()
{
for (zScale = [-1, 1])
{
scale([1, 1, zScale])
linear_extrude(height=5, center=false, convexity=10, twist=rotate_angle, slices=(num_slices / 2))
{
import (file = str("Gear_", num_teeth, ".dxf"), layer = "", origin = 0);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment