// SPDX-License-Identifier: LicenseRef-PD-hp OR CC0-1.0 OR 0BSD OR MIT-0 OR MIT // Define overlap to use for parts that just touch. This is used to make // sure parts are connected if they don't really overlap. overlap = .001; // Define some thicknesses. // Bottom of the box array. bottom_thick = 2; // Box walls wall_thick = 1; // Settings // settings = [width, length, height, rows, columns]; // Default prebuilt settings to use. ba = 44; settings = ba==44? [64,64,30,4,4]: [86,86,30,3,3]; // Base cube([settings[0]*settings[3]+wall_thick*(settings[3]+1)+2*overlap, settings[1]*settings[4]+wall_thick*(settings[4]+1)+2*overlap, bottom_thick]); // Walls translate([0,0,overlap]) linear_extrude(height=settings[2]+bottom_thick-overlap) { // Row dividers for(column=[0:settings[4]]) translate([overlap,overlap+column*(settings[1]+wall_thick),0]) square([settings[0]*settings[3]+wall_thick*(settings[3]+1),wall_thick]); // Column dividers for(row=[0:settings[3]]) translate([overlap+row*(settings[0]+wall_thick),overlap,0]) square([wall_thick,settings[1]*settings[4]+wall_thick*(settings[4]+1)]); }