Skip to content

Instantly share code, notes, and snippets.

@kelliott121
Created Jul 23, 2016
Embed
What would you like to do?
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