Skip to content

Commit

Permalink
Add a light interruptor on the bottom of the thumb down key
Browse files Browse the repository at this point in the history
This adds a small protrusion on the bottom that ensures the light path is
fully blocked when the key is fully pressed.
  • Loading branch information
JesusFreke committed Jun 14, 2021
1 parent aca605a commit 43251fa
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lalboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def make_bottom_entry_led_cavity(self, name="led_cavity"):
leg.place(~leg == ~body, (~leg == ~body) + 2.54/2, +leg == -body)
leg2 = leg.copy().ty(-2.54)
legs = Union(leg, leg2, name="legs")
cavity = SplitFace(cavity, legs)
cavity = SplitFace(cavity, legs, name=name)

cavity.add_named_faces("legs", *cavity.find_faces((leg, leg2)))

Expand Down Expand Up @@ -1123,6 +1123,8 @@ def thumb_down_key(self):
upper_outer_base = self._thumb_upper_outer_base()
cluster_body_thickness = upper_outer_base.find_children("upper_base")[0].size().z

lens_hole = upper_outer_base.find_children("led_cavity")[0].named_faces("lens_hole")[0]

pressed_angle = 7

key_base = Box(14.5, 29, 2.5)
Expand Down Expand Up @@ -1171,6 +1173,16 @@ def thumb_down_key(self):
+magnet == +post,
(~magnet == +post) - 1.9)

interruptor = Box(
key_base.size().x,
lens_hole.size().y * 2,
(upper_outer_base.max().z - lens_hole.max().z) - .2,
name="interruptor")
interruptor.place(
~interruptor == ~key_base,
(~interruptor == -angled_back) + 15.85,
-interruptor == +key_base)

length_from_pivot = key_base.max().y - angled_back.min().y

key_stop_length = (cluster_body_thickness - length_from_pivot * math.sin(
Expand Down Expand Up @@ -1206,7 +1218,7 @@ def thumb_down_key(self):
key_base.shared_edges([key_base.back], [key_base.left, key_base.right])), 1)

assembly = Difference(
Union(filleted_key_base, key_base_extension, post, angled_back),
Union(filleted_key_base, key_base_extension, post, angled_back, interruptor),
magnet, name="thumb_down_key")

assembly.add_named_edges("pivot", assembly.shared_edges(
Expand Down Expand Up @@ -2002,7 +2014,7 @@ def thumb_base(self, name=None):
upper_outer_led_cavity = upper_outer_base.find_children("led_cavity")[0]
down_key_led_cavity.place(
(-down_key_led_cavity == ~down_key) + 8.55,
(~down_key_led_cavity == -down_key_void) + 16,
~down_key_led_cavity == ~down_key.find_children("interruptor")[0],
+down_key_led_cavity == +upper_outer_led_cavity)

down_key_led_cavity = ExtrudeTo(
Expand All @@ -2012,7 +2024,7 @@ def thumb_base(self, name=None):
down_key_pt_cavity = self.make_bottom_entry_led_cavity("down_key_pt_cavity")
down_key_pt_cavity.place(
(+down_key_pt_cavity == ~down_key) - 8.55,
~down_key_pt_cavity == ~down_key_led_cavity,
~down_key_pt_cavity == ~down_key.find_children("interruptor")[0],
+down_key_pt_cavity == +upper_outer_led_cavity)

down_key_pt_cavity = ExtrudeTo(
Expand Down

0 comments on commit 43251fa

Please sign in to comment.