Skip to content

Instantly share code, notes, and snippets.

@ali1234
Created November 20, 2021 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ali1234/7aba2fb4dc313dc2b39411e58ca8b6f1 to your computer and use it in GitHub Desktop.
Save ali1234/7aba2fb4dc313dc2b39411e58ca8b6f1 to your computer and use it in GitHub Desktop.
// [ 56.0, 4*62.0, 48.0, 0.6 ], // WHAM 5.04 outer side large
// [ 56.0, 2*62.0, 48.0, 0.6 ], // WHAM 5.04 outer side small
// [ 56.5, 63.5, 48.0, 0.6 ], // WHAM 5.04 inner
// [ 56.5, 62.5, 48.0, 0.6, [0.125, 0.5, 0.25, 0.125] ], // WHAM 5.04 outer
$fs = 0.1;
module fillet(r) {
offset(r) offset(-r) offset(-r) offset(r)
children();
}
module solidify() {
linear_extrude(height=0.00000001)
children();
}
module round_rect(size, radius) {
fillet(radius) square(size, center=true);
}
module skin(size, height, radius, thickness, nest, inner=false) {
offz = (thickness * 2);
offs = [offz + 0.1, offz + 0.1];
size = inner ? size - [offz, offz] : size;
radius = inner ? max(radius - thickness, 0) : radius;
hull() {
translate([0, 0, inner ? thickness : 0]) solidify() round_rect(size-offs - (inner ? [nest-thickness, nest-thickness] : [0, 0])*2, radius);
translate([0, 0, nest]) solidify() round_rect(size-offs, radius);
}
hull() {
translate([0, 0, nest-0.001]) solidify() round_rect(size-offs, radius);
translate([0, 0, height-nest+0.001]) solidify() round_rect(size, radius);
}
hull() {
translate([0, 0, height-nest]) solidify() round_rect(size, radius);
translate([0, 0, height + (inner? 0.001 : 0)]) solidify() round_rect(size, radius);
}
}
module tray(size, height, radius, thickness, nest, divs) {
difference() {
skin(size, height, radius, thickness, nest);
skin(size, height, radius, thickness, nest, inner=true);
}
// inner walls
intersection() {
skin(size, height, radius, thickness, nest);
union() {
cube([100, thickness, (height-nest)*2], center=true);
cube([thickness, 100, (height-nest)*2], center=true);
}
}
}
intersection() {
tray([56.5, 62.5], 6, 1, 0.8, 1, [1, 2]);
//cube(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment