Last active
April 25, 2017 15:23
-
-
Save winder/8078285 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
// Tube with measurements to fit around something. | |
module fit_outside_tube(dim, thickness, radius) { | |
w = dim[0]; | |
l = dim[1]; | |
h = dim[2]; | |
or = min(w, l) * 0.1; | |
ir = radius; | |
// Extrude the tube | |
linear_extrude(height = h) | |
difference() { | |
rounded_square( | |
[w + thickness*2, l+thickness*2], | |
[or,or,or,or], true); | |
rounded_square([w, l], | |
[ir,ir,ir,ir], true); | |
} | |
} | |
// Tube with measurements to fit inside something. | |
module fit_inside_tube(dim, thickness, radius) { | |
w = dim[0]; | |
l = dim[1]; | |
h = dim[2]; | |
or = radius; | |
ir = min(w, l) * 0.1; | |
linear_extrude(height = h) | |
difference() { | |
rounded_square( | |
[w-slop , l-slop], | |
[or,or,or,or], true); | |
rounded_square( | |
[w - thickness*2, l - thickness*2], | |
[ir,ir,ir,ir], true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would be nice if it had an example of use