$fn = 64; // Parametric Dimensions (in mm) length = 160; width = 100; height = 80; wall_thickness = 3; // 3mm walls for 2kg load capacity corner_radius = 8; // Outer corner rounding rim_width = 4; // Reinforcement lip width rim_height = 6; // Reinforcement lip height // Calculated Inner Dimensions inner_length = length - (wall_thickness * 2); inner_width = width - (wall_thickness * 2); inner_radius = max(0.1, corner_radius - wall_thickness); // Helper module for rounded rectangular prisms module rounded_box(l, w, h, r) { hull() { for (x = [-1, 1]) { for (y = [-1, 1]) { translate([x * (l/2 - r), y * (w/2 - r), 0]) cylinder(r=r, h=h); } } } } union() { // Main bin body difference() { // Outer shell rounded_box(length, width, height, corner_radius); // Inner cavity (height + 1 prevents Z-fighting at the top) translate([0, 0, wall_thickness]) rounded_box(inner_length, inner_width, height + 1, inner_radius); } // Structural top rim for rigidity difference() { // Outer rim volume translate([0, 0, height - rim_height]) rounded_box( length + (rim_width * 2), width + (rim_width * 2), rim_height, corner_radius + rim_width ); // Inner rim cutout (extended to prevent Z-fighting) translate([0, 0, height - rim_height - 1]) rounded_box( inner_length, inner_width, rim_height + 2, inner_radius ); } }