$fn = 64; // --- PARAMETERS --- wall_plate_w = 90; wall_plate_h = 160; wall_plate_t = 5; corner_radius = 8; wall_t = 3; // Torch Holder Dimensions torch_dia = 32; torch_depth = 55; torch_angle = 15; torch_outer_d = torch_dia + (2 * wall_t); // USB Hub Enclosure Dimensions (Fits standard slim 4-port hub) hub_w = 80; hub_d = 25; hub_h = 16; // --- MODULES --- module rounded_plate(w, h, t, r) { hull() { translate([-w/2 + r, 0, r]) rotate([-90, 0, 0]) cylinder(h=t, r=r); translate([w/2 - r, 0, r]) rotate([-90, 0, 0]) cylinder(h=t, r=r); translate([-w/2 + r, 0, h - r]) rotate([-90, 0, 0]) cylinder(h=t, r=r); translate([w/2 - r, 0, h - r]) rotate([-90, 0, 0]) cylinder(h=t, r=r); } } // --- MAIN GEOMETRY --- difference() { union() { // 1. Wall Mounting Plate rounded_plate(wall_plate_w, wall_plate_h, wall_plate_t, corner_radius); // 2. USB Hub Enclosure (Bottom) translate([-hub_w/2 - wall_t, 0, 15]) difference() { // Outer housing cube([hub_w + (2 * wall_t), hub_d + wall_t + wall_plate_t, hub_h + (2 * wall_t)]); // Inner cavity for hub translate([wall_t, wall_plate_t, wall_t]) cube([hub_w, hub_d + wall_t + 1, hub_h]); // Front opening for USB ports translate([wall_t + 5, hub_d + wall_plate_t - 2, wall_t - 1]) cube([hub_w - 10, wall_t + 5, hub_h + 2]); // Cable routing hole (bottom) translate([hub_w/2 + wall_t, wall_plate_t + hub_d/2, -1]) cylinder(h=wall_t + 2, d=12); // Cable routing hole (top, leading to torch) translate([hub_w/2 + wall_t, wall_plate_t + hub_d/2, hub_h + wall_t - 1]) cylinder(h=wall_t + 2, d=12); } // 3. Torch Sconce Holder (Top) difference() { hull() { // Base attachment to wall plate translate([-torch_outer_d/2, 0, wall_plate_h - torch_depth - 15]) cube([torch_outer_d, wall_plate_t, torch_depth + 15]); // Outer cylinder translate([0, wall_plate_t + 15, wall_plate_h - torch_depth]) rotate([-torch_angle, 0, 0]) cylinder(h=torch_depth, d=torch_outer_d); } // Inner cylinder (torch cavity) translate([0, wall_plate_t + 15, wall_plate_h - torch_depth]) rotate([-torch_angle, 0, 0]) translate([0, 0, wall_t]) cylinder(h=torch_depth + 10, d=torch_dia); // Bottom drain / cable hole for torch translate([0, wall_plate_t + 15, wall_plate_h - torch_depth]) rotate([-torch_angle, 0, 0]) translate([0, 0, -1]) cylinder(h=wall_t + 2, d=torch_dia * 0.6); } } // 4. Mounting Screw Holes (4 corners) for(x = [-wall_plate_w/2 + 12, wall_plate_w/2 - 12]) { for(z = [15 + hub_h + (2 * wall_t) + 10, wall_plate_h - 15]) { translate([x, -1, z]) rotate([-90, 0, 0]) { // Main screw shaft cylinder(h=wall_plate_t + 2, d=4.5); // Countersink for screw head translate([0, 0, wall_plate_t - 2]) cylinder(h=4, d1=4.5, d2=9.5); } } } }