// Measured between PCB screws
pcb_width = 66; // x
pcb_length = 58.4; // y
-screw_inside_diam = 2.5;
-screw_outside_diam = 5;
// From screws to PCB edges
pcb_left = 5;
pcb_right = 5;
pcb_front = 5.2;
pcb_back = 10;
+pcb_thickness = 1.5;
// Interior dimensions relative to z=0
box_height = 26;
-box_depth = 10;
+box_depth = 4;
+
+// Screw dimensions
+screw_inside_diam = 2.5;
+screw_outside_diam = 3.2;
+screw_head_diam = 6;
+screw_head_height = 1.4;
+screw_length = 14; // really 12, but make the hole deeper
+
+// Screw holders
+holder_size = 3*2.5;
// Cable hole
cable_x = 9;
usb_bottom = 13.5;
usb_top = 17.5;
-// Lid holders
-holder_width = 10;
-holder_depth = 6;
-holder_tail_depth = 14;
-
// Lid
-lid_thickness = 2;
-lid_screw_thickness = 3.2;
-lid_screw_head_diam = 6;
-lid_screw_head_height = 2.8;
-lid_screw_holder_height = 4; // includes lid_thickness
-// we want lid_screw_holder_height + (holder_depth + holder_tail_depth)/2 >= screw length (13 mm)
+lid_smaller = 0.2;
+lid_left = pcb_left - lid_smaller;
+lid_right = pcb_right - lid_smaller;
+lid_front = pcb_front - lid_smaller;
+lid_back = pcb_back - lid_smaller;
+lid_thickness = 1.8;
text_depth = 1;
over = 0.1;
cylinder(h = front_panel_thickness + 2*over, d = led_diameter);
}
-module screw_hole() {
- translate([0, 0, -box_depth])
- difference() {
- translate([0, 0, -over])
- cylinder(h = box_depth + over, d = screw_outside_diam);
- cylinder(h = box_depth + over, d = screw_inside_diam);
- }
+module screw_holder() {
+ translate([-holder_size/2, -holder_size/2, -box_depth - over])
+ cube([holder_size, holder_size, box_depth + over]);
}
-module lid_holder() {
- difference() {
- rotate([90, 0, 0])
- linear_extrude(height = holder_width, center = true)
- polygon(points = [[0,0], [0,-holder_tail_depth], [holder_width,-holder_depth], [holder_width,0]]);
-
- translate([holder_width/2, 0, -holder_depth])
- cylinder(h = holder_depth + over, d = screw_inside_diam);
- }
+module screw_hole() {
+ translate([0, 0, -box_depth - wall_thickness - over])
+ union() {
+ cylinder(h = box_depth + wall_thickness + 2*over, d = screw_outside_diam);
+ cylinder(h = screw_head_height, d1 = screw_head_diam, d2 = screw_outside_diam);
+ }
}
-module bottom() {
+module bottom_base() {
union() {
difference() {
// Exterior
rotate([-90, 0, 0])
cylinder(h = wall_thickness + 2*over, d = cable_diameter);
}
+ }
+}
+
+module bottom() {
+ difference() {
+ union() {
+ bottom_base();
+
+ // Screw holder
+ screw_holder();
+ translate([pcb_width, 0, 0]) screw_holder();
+ translate([0, pcb_length, 0]) screw_holder();
+ translate([pcb_width, pcb_length, 0]) screw_holder();
+ }
// Screw holes
screw_hole();
translate([pcb_width, 0, 0]) screw_hole();
translate([0, pcb_length, 0]) screw_hole();
translate([pcb_width, pcb_length, 0]) screw_hole();
-
- // Lid holders
- lh = box_height - lid_screw_holder_height;
- translate([-pcb_left, 0, lh])
- lid_holder();
- translate([-pcb_left, pcb_length, lh])
- lid_holder();
- translate([pcb_width + pcb_right, 0, lh])
- rotate([0, 0, 180])
- lid_holder();
- translate([pcb_width + pcb_right, pcb_length, lh])
- rotate([0, 0, 180])
- lid_holder();
}
}
-module lid_screw_holder() {
- translate([-holder_width/2, -holder_width/2, -lid_screw_holder_height])
- cube([holder_width, holder_width, lid_screw_holder_height]);
-}
-
-module lid_screw_hole() {
- translate([0, 0, -lid_screw_holder_height - over])
- cylinder(h = lid_screw_holder_height + 2*over, d = lid_screw_thickness);
- translate([0, 0, -lid_screw_head_height])
- cylinder(h = lid_screw_head_height + over, d1 = lid_screw_thickness, d2 = lid_screw_head_diam);
-}
-
module lid_text(overshoot = 0) {
translate([pcb_width / 2, 10, -text_depth/2])
rotate(0)
text("USB – BSB", font = "Liberation Serif", halign="center");
}
+module lid_screw_hole() {
+ translate([0, 0, -box_height + pcb_thickness])
+ difference() {
+ translate([-holder_size/2, -holder_size/2, 0])
+ cube([holder_size, holder_size, box_height - pcb_thickness - lid_thickness + over]);
+ translate([0, 0, -over])
+ cylinder(h = screw_length - pcb_thickness - box_depth - wall_thickness + over, d = screw_inside_diam);
+ }
+}
+
module lid() {
difference() {
union() {
- translate([-pcb_left, -pcb_front, -lid_thickness])
- cube([pcb_left + pcb_width + pcb_right, pcb_front + pcb_length + pcb_back, lid_thickness]);
-
- translate([0, 0, 0])
- lid_screw_holder();
- translate([0, pcb_length, 0])
- lid_screw_holder();
- translate([pcb_width, 0, 0])
- lid_screw_holder();
- translate([pcb_width, pcb_length, 0])
- lid_screw_holder();
- }
-
- // Screw holes
- translate([0, 0, 0])
- lid_screw_hole();
- translate([0, pcb_length, 0])
- lid_screw_hole();
- translate([pcb_width, 0, 0])
- lid_screw_hole();
- translate([pcb_width, pcb_length, 0])
+ translate([-lid_left, -lid_front, -lid_thickness])
+ cube([lid_left + pcb_width + lid_right, lid_front + pcb_length + lid_back, lid_thickness]);
lid_screw_hole();
+ translate([pcb_width, 0, 0]) lid_screw_hole();
+ translate([0, pcb_length, 0]) lid_screw_hole();
+ translate([pcb_width, pcb_length, 0]) lid_screw_hole();
+ }
// Text
lid_text(over);
}
}
+module pcb() {
+ translate([-pcb_left, -pcb_front, 0])
+ cube([pcb_left + pcb_width + pcb_right, pcb_front + pcb_length + pcb_back, pcb_thickness]);
+}
+
bottom();
-// color([1, 0, 0]) translate([0, 0, box_height]) lid();
+// color([1, 0, 1]) pcb();
+color([1, 0, 0]) translate([0, 0, box_height]) lid();
// color([0, 0, 1]) translate([0, 0, box_height]) lid_text(0);