/* CONFIG PART */ desk_thickness = 8; moulding_size = 10; thickness = 5; rounding = 2; $fn = 30; /* END OF CONFIG PART */ top_width = moulding_size + thickness * 2; bottom_width = top_width + desk_thickness * 2; top_depth = moulding_size + thickness; bottom_depth = moulding_size; full_depth = top_depth + bottom_depth; module rounded_square(width, height, rounded = true) { if (!rounded) { square([width, height], center = true); } else { hull() { move_x = width / 2 - rounding; move_y = height / 2 - rounding; translate([move_x, move_y]) circle(r = rounding); translate([-move_x, move_y]) circle(r = rounding); translate([move_x, -move_y]) circle(r = rounding); translate([-move_x, -move_y]) circle(r = rounding); } } } module base() { translate([0, -full_depth / 2]) hull() { translate([0, top_depth / 2 + bottom_depth]) { rounded_square(top_width, top_depth); } translate([0, bottom_depth / 2]) { rounded_square(bottom_width, bottom_depth); } } } module without_moulding() { difference() { base(); translate([0, full_depth / 2 - moulding_size / 2]) { rounded_square(moulding_size, moulding_size, false); } } } without_moulding();