Created
July 30, 2016 16:00
-
-
Save wmealing/d0b4c1b3c15b325876c2e4a599784b1b to your computer and use it in GitHub Desktop.
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
/* 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