diff options
author | xengineering <me@xengineering.eu> | 2023-12-23 16:17:10 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-01-02 14:24:06 +0100 |
commit | c9705864963f4a3a3c946bf55e657211009daeff (patch) | |
tree | f3f7f980579c7803b6dd2ebf1d3b56d240ea99ba /mech | |
parent | 42ffc886165ca070874fa13b105fcbfc266221d9 (diff) | |
download | soundbox-c9705864963f4a3a3c946bf55e657211009daeff.tar soundbox-c9705864963f4a3a3c946bf55e657211009daeff.tar.zst soundbox-c9705864963f4a3a3c946bf55e657211009daeff.zip |
mech: pcb_case: Add nut tolerance test
This part can be used to fine-tune the tolerance for the used nuts which
have to fit tightly into a 3D-printed part.
Diffstat (limited to 'mech')
-rw-r--r-- | mech/mech.mk | 2 | ||||
-rw-r--r-- | mech/pcb_case/nut.scad | 23 |
2 files changed, 23 insertions, 2 deletions
diff --git a/mech/mech.mk b/mech/mech.mk index 6807c03..c92ef7b 100644 --- a/mech/mech.mk +++ b/mech/mech.mk @@ -1,5 +1,5 @@ MECH_BUILD_DIR := $(BUILD_DIR)/mech -PARTS := bottom top back front +PARTS := bottom top back front pcb_case/nut STL := $(PARTS:%=$(MECH_BUILD_DIR)/%.stl) GCODE := $(PARTS:%=$(MECH_BUILD_DIR)/%.gcode) diff --git a/mech/pcb_case/nut.scad b/mech/pcb_case/nut.scad index bfd5b3d..407ab09 100644 --- a/mech/pcb_case/nut.scad +++ b/mech/pcb_case/nut.scad @@ -1,9 +1,30 @@ nut_h = 3; nut_d = 4.15; nut_r = nut_d / 2; +nut_d_tol = 0.5; module nut() { cylinder(d=nut_d,h=nut_h); } -nut(); +module nut_tolerance_test() { + steps = 3; + step_width = 0.1; + + for(i = [-steps : steps]) { + tol = nut_d_tol + i * step_width; + 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=nut_d,h=2*nut_h,$fn=50); + translate([0,0,nut_h]) + cylinder(d=nut_d_tol+nut_d,h=nut_h,$fn=50); + } + } + } + } +} + +nut_tolerance_test(); |