$fn=64; // --- Parameters --- hub_length = 105; // Length of the USB hub (inner tray dimension) hub_width = 45; // Width of the USB hub (inner tray dimension) riser_height = 50; // Height of the riser platform hex_radius = 35; // Radius of the hexagonal base pillar lip_height = 8; // Height of the retaining lip around the tray wall_thickness = 2; // Thickness of the walls and tray floor cable_cutout_width = 20; // Width of the cable routing gaps // --- Main Assembly --- union() { // Hexagonal Pillar Base // Rotated by 30 degrees to align flat sides with the rectangular tray // Height is extended by 0.1mm to ensure a manifold union with the tray rotate([0, 0, 30]) cylinder(h = riser_height + 0.1, r = hex_radius, $fn = 6); // Top Platform / Tray translate([0, 0, riser_height]) difference() { // Outer Tray Body translate([-(hub_length + 2*wall_thickness)/2, -(hub_width + 2*wall_thickness)/2, 0]) cube([hub_length + 2*wall_thickness, hub_width + 2*wall_thickness, wall_thickness + lip_height]); // Inner Cutout for Hub translate([-hub_length/2, -hub_width/2, wall_thickness]) cube([hub_length, hub_width, lip_height + 1]); // Cable Cutout - Front translate([-cable_cutout_width/2, -(hub_width/2) - wall_thickness - 0.5, wall_thickness]) cube([cable_cutout_width, wall_thickness + 1, lip_height + 1]); // Cable Cutout - Back translate([-cable_cutout_width/2, hub_width/2 - 0.5, wall_thickness]) cube([cable_cutout_width, wall_thickness + 1, lip_height + 1]); // Cable Cutout - Left translate([-(hub_length/2) - wall_thickness - 0.5, -cable_cutout_width/2, wall_thickness]) cube([wall_thickness + 1, cable_cutout_width, lip_height + 1]); // Cable Cutout - Right translate([hub_length/2 - 0.5, -cable_cutout_width/2, wall_thickness]) cube([wall_thickness + 1, cable_cutout_width, lip_height + 1]); } }