// Open box with perforated floor, walls and internal dividers // All dimensions in mm. Open Window > Customizer to edit the parameters. // Number fields accept any value to 0.01 mm (type it, or use the arrows). /* [Box] */ // Inner length (wall to wall) Li = 136.0; // 0.01 // Inner width (wall to wall) Wi = 55.0; // 0.01 // Inner depth (top of floor to rim) Hi = 118.0; // 0.01 // Outer wall thickness (added outside the inner size) wall = 2.0; // 0.01 // Floor thickness (added below the inner depth) floor_t = 2.0; // 0.01 // Inner vertical corner radius (outer radius = this + wall) r_in = 1.0; // 0.01 /* [Holes] */ // Hole size: across flats (hexagon) or side length (diamond) hole = 6.0; // 0.01 // Material between holes (>= 3-4 line widths) web = 1.6; // 0.01 // Solid border around each perforated panel margin = 6.0; // 0.01 // Walls and dividers: diamond = 45 deg roofs, hex_pointy = 30 deg roofs, hex_flat = flat bridges side_shape = "diamond"; // [diamond, hex_pointy, hex_flat] // Floor holes are vertical, so the shape only affects looks floor_shape = "diamond"; // [diamond, hex_pointy, hex_flat] /* [Dividers] */ // Number of internal walls n_div = 2; // [0:1:8] // Divider thickness div_t = 2.0; // 0.01 // Divider height above the floor (clipped to the box height; leave room on top for flat blisters) div_h = 90.0; // 0.01 // across = span the width and brace the long walls; along = run the full length div_axis = "across"; // [across, along] // Perforate the dividers too (keeps gas circulating) div_holes = true; /* [Hidden] */ $fn = 48; eps = 0.01; L = Li + 2*wall; // outer length W = Wi + 2*wall; // outer width H = Hi + floor_t; // outer height r_corner = r_in + wall; // outer corner radius hd = min(div_h, Hi); // actual divider height above floor div_top = floor_t + hd; // divider top, world z span = div_axis == "across" ? Li : Wi; // inner dimension being divided comp = (span - n_div*div_t) / (n_div + 1); // compartment width div_c = [for (i = [1:1:n_div]) -span/2 + i*comp + (i - 0.5)*div_t]; solid_w = div_t + 2*web; // solid strip kept where a divider joins echo(str("Outer size: ", L, " x ", W, " x ", H, " mm")); echo(str("Compartment inner width: ", comp, " mm (", n_div + 1, " compartments, ", div_axis, ")")); echo(str("Divider height: ", hd, " mm; free space above dividers: ", H - div_top, " mm")); module rounded_rect(l, w, r) offset(r) square([l - 2*r, w - 2*r], center = true); // One hole, centred at the origin module hole_shape(shape) { Rh = hole / sqrt(3); // hexagon circumradius if (shape == "diamond") rotate(45) square(hole, center = true); else if (shape == "hex_pointy") rotate(30) circle(r = Rh, $fn = 6); else circle(r = Rh, $fn = 6); } // Whole holes tiled inside an a x b rectangle (centred), uniform web between // all neighbours. Local y is vertical when used in a wall. // gx / gy: positions along local x / y where a solid strip of width gw is kept. // gx_top: the gx strips only run up to this local y (plus one web). module hole_grid(a, b, shape = "hex_flat", gx = [], gy = [], gw = 0, gx_top = 1e9) { p = hole + web; // centre spacing between neighbours q = p * sqrt(3) / 2; d = p * sqrt(2); // diamond: spacing within a row Rh = hole / sqrt(3); sx = shape == "diamond" ? d : shape == "hex_pointy" ? p : q; sy = shape == "diamond" ? d/2 : shape == "hex_pointy" ? q : p; row_shift = shape != "hex_flat"; ex = shape == "diamond" ? hole/sqrt(2) : shape == "hex_pointy" ? hole/2 : Rh; ey = shape == "diamond" ? hole/sqrt(2) : shape == "hex_pointy" ? Rh : hole/2; nx = ceil(a / sx) + 1; ny = ceil(b / sy) + 1; for (i = [-nx:nx], j = [-ny:ny]) { x = i*sx + ((row_shift && j % 2 != 0) ? sx/2 : 0); y = j*sy + ((!row_shift && i % 2 != 0) ? sy/2 : 0); clear = len([for (g = gx) if (abs(x - g) < gw/2 + ex && y - ey < gx_top + web) 1]) == 0 && len([for (g = gy) if (abs(y - g) < gw/2 + ey) 1]) == 0; if (clear && abs(x) <= a/2 - ex && abs(y) <= b/2 - ey) translate([x, y]) hole_shape(shape); } } module shell() { top_local = div_top - H/2; // divider top in wall-panel coords difference() { linear_extrude(H) rounded_rect(L, W, r_corner); translate([0, 0, floor_t]) linear_extrude(H) rounded_rect(Li, Wi, max(r_in, 0.01)); // floor (solid strips left under the dividers) translate([0, 0, -1]) linear_extrude(floor_t + 2) hole_grid(L - 2*margin, W - 2*margin, floor_shape, gx = div_axis == "across" ? div_c : [], gy = div_axis == "along" ? div_c : [], gw = solid_w); // long walls for (s = [-1, 1]) translate([0, s * W/2, H/2]) rotate([90, 0, 0]) linear_extrude(wall * 3, center = true) hole_grid(L - 2*margin, H - 2*margin, side_shape, gx = div_axis == "across" ? div_c : [], gw = solid_w, gx_top = top_local); // end walls for (s = [-1, 1]) translate([s * L/2, 0, H/2]) rotate([90, 0, 90]) linear_extrude(wall * 3, center = true) hole_grid(W - 2*margin, H - 2*margin, side_shape, gx = div_axis == "along" ? div_c : [], gw = solid_w, gx_top = top_local); } } module divider(c) { ov = 0.5; // overlap into outer walls if (div_axis == "across") { difference() { translate([c - div_t/2, -Wi/2 - ov, floor_t - eps]) cube([div_t, Wi + 2*ov, hd + eps]); if (div_holes) translate([c, 0, floor_t + hd/2]) rotate([90, 0, 90]) linear_extrude(div_t * 3, center = true) hole_grid(Wi - 2*margin, hd - 2*margin, side_shape); } } else { difference() { translate([-Li/2 - ov, c - div_t/2, floor_t - eps]) cube([Li + 2*ov, div_t, hd + eps]); if (div_holes) translate([0, c, floor_t + hd/2]) rotate([90, 0, 0]) linear_extrude(div_t * 3, center = true) hole_grid(Li - 2*margin, hd - 2*margin, side_shape); } } } union() { shell(); if (hd > 0) for (c = div_c) divider(c); }