Skip to content

Commit

Permalink
feat: remove 3.7mm latch constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
gcollic committed May 17, 2024
1 parent da1f4e8 commit 91718ac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions boxes/generators/sidehingebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def render(self):
hinge_radius = self.hinge_radius
hinge_center = self.hinge_center if self.hinge_center else 2*t + hinge_radius
with_latch = self.cherrymx_latch
if with_latch and t>3.7:
raise "cherrymx_latch not compatible with thickness > 3.7mm"
self.mx_width = 15.4
self.mx_length = t+16.4+2.8 #2.8 can be removed if the switch is trimmed flush

Expand Down Expand Up @@ -122,7 +120,8 @@ def render(self):
ear_t = 0.4;
ear_d = 15;
btn_d = 11.4;
btn_h = ear_t + plywood_t*2;
btn_ext_h = min(plywood_t, 3.7);
btn_h = ear_t + plywood_t + btn_ext_h;
module mx_outer() {{
translate([0,0,btn_h+4])
mirror([0,0,1])
Expand All @@ -148,11 +147,11 @@ def render(self):
}};
}}
}}
angle = atan2(plywood_t+0.2, btn_d/2);
angle = atan2(btn_ext_h+0.2, btn_d/2);
rotate([0, angle, 0]) difference(){{
union(){{
cylinder(d=btn_d-2*play, h=btn_h, $fn=512);
translate([0, 0, ear_t/2+plywood_t*2])
translate([0, 0, btn_h-ear_t/2])
cube([btn_d/2, ear_d, ear_t], center=true);
mx_outer();
}}
Expand Down

0 comments on commit 91718ac

Please sign in to comment.