summaryrefslogtreecommitdiff
path: root/mech
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-01-01 14:09:52 +0100
committerxengineering <me@xengineering.eu>2024-01-02 14:24:58 +0100
commit710206dfcaf4ddff2983797cf7b7fc19377cebec (patch)
treedf10156562aad760ec594c68c81a8037da229a5b /mech
parentd5655c62a5016f89f3b7fc8f6c2f9db68479b261 (diff)
downloadsoundbox-710206dfcaf4ddff2983797cf7b7fc19377cebec.tar
soundbox-710206dfcaf4ddff2983797cf7b7fc19377cebec.tar.zst
soundbox-710206dfcaf4ddff2983797cf7b7fc19377cebec.zip
mech: pcb_case: Move tolerance tests to one file
This makes the file structure and module naming simpler and allows to easily print all tolerance tests at once. This is helpful to validate a specific printer setup.
Diffstat (limited to 'mech')
-rw-r--r--mech/mech.mk2
-rw-r--r--mech/pcb_case/bolt_tolerance_test.scad21
-rw-r--r--mech/pcb_case/nut_tolerance_test.scad25
-rw-r--r--mech/pcb_case/panel_size_tolerance_test.scad26
-rw-r--r--mech/pcb_case/panel_thickness_tolerance_test.scad25
-rw-r--r--mech/pcb_case/tolerance_tests.scad95
6 files changed, 96 insertions, 98 deletions
diff --git a/mech/mech.mk b/mech/mech.mk
index 7758dcf..b683a4d 100644
--- a/mech/mech.mk
+++ b/mech/mech.mk
@@ -1,7 +1,7 @@
PRINTER := anycubic_i3_mega_s
PRINTER_CONFIG := $(PRINTER:%=mech/prusa-slicer/%.ini)
MECH_BUILD_DIR := $(BUILD_DIR)/mech
-PARTS := bottom top back front pcb_case/nut_tolerance_test pcb_case/bolt_tolerance_test pcb_case/panel_thickness_tolerance_test pcb_case/panel_size_tolerance_test
+PARTS := bottom top back front pcb_case/tolerance_tests
STL := $(PARTS:%=$(MECH_BUILD_DIR)/%.stl)
GCODE := $(PARTS:%=$(MECH_BUILD_DIR)/%.gcode)
diff --git a/mech/pcb_case/bolt_tolerance_test.scad b/mech/pcb_case/bolt_tolerance_test.scad
deleted file mode 100644
index b658183..0000000
--- a/mech/pcb_case/bolt_tolerance_test.scad
+++ /dev/null
@@ -1,21 +0,0 @@
-include <bolt.scad>
-
-module bolt_tolerance_test() {
- steps = 3;
- step_width = 0.1;
- height = 3;
-
- for(i = [-steps : steps]) {
- tol = bolt_ds_tol + i * step_width;
- echo(tol=tol);
- translate([i*5*bolt_ds,0,0])
- difference() {
- cube([5*bolt_ds, 5*bolt_ds, height]);
- translate([2.5*bolt_ds,2.5*bolt_ds,0]) {
- cylinder(d=bolt_ds+tol,h=height,$fn=50);
- }
- }
- }
-}
-
-bolt_tolerance_test();
diff --git a/mech/pcb_case/nut_tolerance_test.scad b/mech/pcb_case/nut_tolerance_test.scad
deleted file mode 100644
index e1df2b4..0000000
--- a/mech/pcb_case/nut_tolerance_test.scad
+++ /dev/null
@@ -1,25 +0,0 @@
-include <nut.scad>
-include <bolt.scad>
-
-module nut_tolerance_test() {
- steps = 3;
- step_width = 0.1;
-
- for(i = [-steps : steps]) {
- tol = nut_d_tol + i * step_width;
- echo(tol=tol);
- translate([i*5*nut_d,0,0])
- difference() {
- cube([5*nut_d, 5*nut_d, 2*nut_h]);
- translate([2.5*nut_d,2.5*nut_d,0]) {
- union() {
- cylinder(d=bolt_ds,h=2*nut_h,$fn=50);
- translate([0,0,nut_h])
- cylinder(d=tol+nut_d,h=nut_h,$fn=50);
- }
- }
- }
- }
-}
-
-nut_tolerance_test();
diff --git a/mech/pcb_case/panel_size_tolerance_test.scad b/mech/pcb_case/panel_size_tolerance_test.scad
deleted file mode 100644
index 8a0b20b..0000000
--- a/mech/pcb_case/panel_size_tolerance_test.scad
+++ /dev/null
@@ -1,26 +0,0 @@
-use <rounded_cube.scad>
-
-t = 2;
-t_tol = 0.4;
-current_tol = 0.8;
-height = 3*t;
-
-module panel_size_tolerance_test() {
- steps = 3;
- step_width = 0.2;
-
- for(i = [-steps : steps]) {
- tol = current_tol + i * step_width;
- echo(tol=tol);
- translate([i*3*t,0,0])
- difference() {
- cube([3*t, 8*t, height]);
- translate([t, t-tol/2, t]) {
- rounded_cube([t, 6*t+tol, 6*t+tol], t);
- }
- }
- }
-}
-
-panel_size_tolerance_test();
-translate([0, 9*t, 0]) rotate([0, -90, 0]) rounded_cube([t, 6*t, 6*t], t);
diff --git a/mech/pcb_case/panel_thickness_tolerance_test.scad b/mech/pcb_case/panel_thickness_tolerance_test.scad
deleted file mode 100644
index a9080e4..0000000
--- a/mech/pcb_case/panel_thickness_tolerance_test.scad
+++ /dev/null
@@ -1,25 +0,0 @@
-use <rounded_cube.scad>
-
-t = 2;
-current_tol = 0.4;
-height = 2*t;
-
-module panel_thickness_tolerance_test() {
- steps = 3;
- step_width = 0.2;
-
- for(i = [-steps : steps]) {
- tol = current_tol + i * step_width;
- echo(tol=tol);
- translate([i*5*t,0,0])
- difference() {
- cube([5*t, 5*t, height]);
- translate([2*t, 0, t]) {
- cube([t+tol, 5*t, t]);
- }
- }
- }
-}
-
-panel_thickness_tolerance_test();
-translate([0, 6*t, 0]) rotate([0, -90, 0]) rounded_cube([t, 4*t, 7*t], t);
diff --git a/mech/pcb_case/tolerance_tests.scad b/mech/pcb_case/tolerance_tests.scad
new file mode 100644
index 0000000..476cd35
--- /dev/null
+++ b/mech/pcb_case/tolerance_tests.scad
@@ -0,0 +1,95 @@
+include <bolt.scad>
+include <nut.scad>
+
+use <rounded_cube.scad>
+
+module bolt_drilling() {
+ steps = 3;
+ step_width = 0.1;
+ height = 3;
+
+ for(i = [-steps : steps]) {
+ tol = bolt_ds_tol + i * step_width;
+ echo(tol=tol);
+ translate([i*5*bolt_ds,0,0])
+ difference() {
+ cube([5*bolt_ds, 5*bolt_ds, height]);
+ translate([2.5*bolt_ds,2.5*bolt_ds,0]) {
+ cylinder(d=bolt_ds+tol,h=height,$fn=50);
+ }
+ }
+ }
+}
+
+module nut_drilling() {
+ steps = 3;
+ step_width = 0.1;
+
+ for(i = [-steps : steps]) {
+ tol = nut_d_tol + i * step_width;
+ echo(tol=tol);
+ translate([i*5*nut_d,0,0])
+ difference() {
+ cube([5*nut_d, 5*nut_d, 2*nut_h]);
+ translate([2.5*nut_d,2.5*nut_d,0]) {
+ union() {
+ cylinder(d=bolt_ds,h=2*nut_h,$fn=50);
+ translate([0,0,nut_h])
+ cylinder(d=tol+nut_d,h=nut_h,$fn=50);
+ }
+ }
+ }
+ }
+}
+
+module panel_width_height() {
+ steps = 3;
+ step_width = 0.2;
+
+ t = 2;
+ t_tol = 0.4;
+ current_tol = 0.8;
+ height = 3*t;
+
+ for(i = [-steps : steps]) {
+ tol = current_tol + i * step_width;
+ echo(tol=tol);
+ translate([i*3*t,0,0])
+ difference() {
+ cube([3*t, 8*t, height]);
+ translate([t, t-tol/2, t]) {
+ rounded_cube([t, 6*t+tol, 6*t+tol], t);
+ }
+ }
+ }
+
+ translate([0, 9*t, 0]) rotate([0, -90, 0]) rounded_cube([t, 6*t, 6*t], t);
+}
+
+module panel_thickness() {
+ steps = 3;
+ step_width = 0.2;
+
+ t = 2;
+ current_tol = 0.4;
+ height = 2*t;
+
+ for(i = [-steps : steps]) {
+ tol = current_tol + i * step_width;
+ echo(tol=tol);
+ translate([i*5*t,0,0])
+ difference() {
+ cube([5*t, 5*t, height]);
+ translate([2*t, 0, t]) {
+ cube([t+tol, 5*t, t]);
+ }
+ }
+ }
+
+ translate([0, 6*t, 0]) rotate([0, -90, 0]) rounded_cube([t, 4*t, 7*t], t);
+}
+
+bolt_drilling();
+translate([0, 20, 0]) nut_drilling();
+translate([0, 50, 0]) panel_width_height();
+translate([0, 90, 0]) panel_thickness();