Skip to content

Instantly share code, notes, and snippets.

@winder
Last active April 25, 2017 15:23
Show Gist options
  • Save winder/8078285 to your computer and use it in GitHub Desktop.
Save winder/8078285 to your computer and use it in GitHub Desktop.
// 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);
}
}
@profK
Copy link

profK commented Apr 25, 2017

Would be nice if it had an example of use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment