summaryrefslogtreecommitdiff
path: root/mech
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-01-01 15:40:19 +0100
committerxengineering <me@xengineering.eu>2024-01-02 14:24:58 +0100
commit6801dc339127f5fdc6aae5ffbd037c8a1fd9f6d3 (patch)
tree8ab107b60194c389b1d2fd54063319f3d2123b89 /mech
parent9d7110c962065331c743618e0b011638e3890682 (diff)
downloadsoundbox-6801dc339127f5fdc6aae5ffbd037c8a1fd9f6d3.tar
soundbox-6801dc339127f5fdc6aae5ffbd037c8a1fd9f6d3.tar.zst
soundbox-6801dc339127f5fdc6aae5ffbd037c8a1fd9f6d3.zip
mech: pcb_case: Apply tolerances to PCB case parts
This makes the results of tolerance tests available for the actual PCB case.
Diffstat (limited to 'mech')
-rw-r--r--mech/pcb_case/shell.scad24
1 files changed, 18 insertions, 6 deletions
diff --git a/mech/pcb_case/shell.scad b/mech/pcb_case/shell.scad
index 555b760..453100a 100644
--- a/mech/pcb_case/shell.scad
+++ b/mech/pcb_case/shell.scad
@@ -1,26 +1,38 @@
include <bolt.scad>
include <nut.scad>
+include <panel.scad>
use <rounded_cube.scad>
module shell_base(dim, t) {
radius = t;
difference() {
+ // full body
rounded_cube(dim, radius);
+
+ // cut away upper half
translate([0,0,dim[2]/2])
cube([dim[0], dim[1], dim[2]/2]);
+
+ // main PCB space
translate([3*t, t, t])
rounded_cube([dim[0]-6*t, dim[1]-2*t, dim[2]-2*t], radius);
+
+ // remove front and back
translate([0, 2*t, 2*t])
rounded_cube([dim[0], dim[1]-4*t, dim[2]-4*t], radius);
+
+ // panel holder
for (x_off = [t, dim[0]-2*t]) {
translate([x_off, t, t])
- rounded_cube([t, dim[1]-2*t, dim[2]-2*t], radius);
+ rounded_cube([t+panel_dim_0_tol, dim[1]-2*t+panel_dim_1_2_tol, dim[2]-2*t+panel_dim_1_2_tol], radius);
}
+
+ // bolt drillings
for (x = [dim[0]/4, dim[0]-dim[0]/4]) {
translate([x,0,dim[2]/2-1.5*bolt_ds])
rotate([-90,0,0])
- cylinder(d=bolt_ds, h=1.1*t, $fn=30);
+ cylinder(d=bolt_ds+bolt_ds_tol, h=1.1*t, $fn=30);
}
}
}
@@ -39,14 +51,14 @@ module shell_connector(dim, t) {
for (x = [dim[0]/4, dim[0]-dim[0]/4]) {
translate([x,dim[1]-t,dim[2]/2+1.5*bolt_ds])
rotate([90,0,0])
- cylinder(d=bolt_ds, h=size_y, $fn=30);
+ cylinder(d=bolt_ds+bolt_ds_tol, h=size_y, $fn=30);
}
// nut holes
for (x = [dim[0]/4, dim[0]-dim[0]/4]) {
translate([x,dim[1]-t-size_y,dim[2]/2+1.5*bolt_ds])
rotate([-90,0,0])
- cylinder(d=nut_d, h=nut_h, $fn=30);
+ cylinder(d=nut_d+nut_d_tol, h=nut_h, $fn=30);
}
}
@@ -66,8 +78,8 @@ module pcb_case_shell(dim, t, h, sockets) {
}
for (socket = sockets) {
translate([socket[0], socket[1], 0]) {
- cylinder(d=bolt_ds, h=h, $fn=30);
- cylinder(d=0.9*nut_d, h=nut_h, $fn=30);
+ cylinder(d=bolt_ds+bolt_ds_tol, h=h, $fn=30);
+ cylinder(d=nut_d+nut_d_tol, h=nut_h, $fn=30);
}
}
}