Skip to content

Instantly share code, notes, and snippets.

@wmealing
Created July 30, 2016 16:00
Show Gist options
  • Save wmealing/d0b4c1b3c15b325876c2e4a599784b1b to your computer and use it in GitHub Desktop.
Save wmealing/d0b4c1b3c15b325876c2e4a599784b1b to your computer and use it in GitHub Desktop.
/* radius = 40;
height = 60;
offset = 33.282;
width = 3;
*/
/* so apparently we find the angle we need to rotate it by with inverse sign */
module draw_curve(height, radius, offset) {
hypotenuse = sqrt ( ( radius* radius ) + ( height * height ) );
point_angle = asin( radius / hypotenuse );
difference() {
cylinder(h = height, r1 = radius, r2 = 0);
translate([-radius,radius - offset,0]) {
rotate([point_angle,0,0]) {
translate([0,0, -hypotenuse / 2]) {
cube([radius * 2,radius,hypotenuse * 2]);
}
}
}
}
}
module cut_curve() {
difference() {
draw_curve(height=60,radius=40, offset=33.282);
draw_curve(height=55,radius=35, offset=33.282 - 5);
}
}
module slice_cut(radius, height) {
intersection() {
cut_curve();
hypotenuse = sqrt ( ( radius* radius ) + ( height * height ) );
point_angle = asin( radius / hypotenuse );
translate([-radius,12,-10]) {
rotate([point_angle, 0,0]) { cube([radius * 2,150,60]); };
}
}
}
slice_cut(40,60);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment