$fn = 64; // --- Parameters --- num_bins = 5; // Number of storage sections bin_width = 30; // Internal width of each bin (mm) bin_depth = 40; // Internal depth of each bin (mm) bin_height = 20; // Internal height of each bin (mm) wall = 2; // Wall thickness (mm) // Label settings labels = ["10Ω", "100Ω", "1kΩ", "10kΩ", "100kΩ"]; text_size = 6; text_depth = 0.6; // Engraving depth for labels // --- Calculated Dimensions --- total_width = num_bins * bin_width + (num_bins + 1) * wall; total_depth = bin_depth + 2 * wall; total_height = bin_height + wall; // --- Modules --- // Creates the hollow shape for a single bin with a slanted front scoop module bin_hollow() { ramp_w = 12; // Depth of the bottom scoop slope ramp_h = 12; // Height of the bottom scoop slope hull() { // Back bottom portion translate([0, ramp_w, 0]) cube([bin_width, bin_depth - ramp_w, bin_height + 1]); // Top full-width portion translate([0, 0, ramp_h]) cube([bin_width, bin_depth, bin_height - ramp_h + 1]); } } // --- Main Geometry --- difference() { // Main solid body cube([total_width, total_depth, total_height]); // Subtract bin hollows for (i = [0 : num_bins - 1]) { x_pos = wall + i * (bin_width + wall); translate([x_pos, wall, wall]) bin_hollow(); } // Subtract engraved labels on the front face for (i = [0 : num_bins - 1]) { x_pos = wall + i * (bin_width + wall) + (bin_width / 2); // Fallback to section number if label array is too short lbl = i < len(labels) ? labels[i] : str(i + 1); translate([x_pos, text_depth, total_height / 2]) rotate([90, 0, 0]) linear_extrude(text_depth + 0.1) text(lbl, size=text_size, halign="center", valign="center"); } }