From 8465432b8c7a6c5cc0edfd174581635c4279f338 Mon Sep 17 00:00:00 2001 From: carbonfet <59760875+carbonfet@users.noreply.github.com> Date: Sat, 5 Dec 2020 19:54:01 -0500 Subject: [PATCH] Update dactyl.clj Screw posts now behave better when switching between different layout styles. --- src/dactyl_keyboard/dactyl.clj | 43 ++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/src/dactyl_keyboard/dactyl.clj b/src/dactyl_keyboard/dactyl.clj index 26972e4..f19c0b4 100644 --- a/src/dactyl_keyboard/dactyl.clj +++ b/src/dactyl_keyboard/dactyl.clj @@ -949,7 +949,6 @@ (key-place (+ innercol-offset 3) cornerrow web-post-br) (key-place (+ innercol-offset 4) cornerrow web-post-bl)))))) - ;switching connectors, switchplates, etc. depending on thumb-style used (when (= thumb-style "default") (def thumb-type thumb) @@ -1332,12 +1331,46 @@ (->> (screw-insert-shape bottom-radius top-radius height) (translate (map + offset [(first position) (second position) (/ height 2)]))))) +; Offsets for the screw inserts dependent on extra-row & pinky-15u +(when (and pinky-15u extra-row) + (def screw-offset-tr [1 7 0]) + (def screw-offset-br [7 14 0])) +(when (and pinky-15u (false? extra-row)) + (def screw-offset-tr [1 7 0]) + (def screw-offset-br [6.5 15.5 0])) +(when (and (false? pinky-15u) extra-row) + (def screw-offset-tr [-3.5 6.5 0]) + (def screw-offset-br [-3.5 -6.5 0])) +(when (and (false? pinky-15u) (false? extra-row)) + (def screw-offset-tr [-4 6.5 0]) + (def screw-offset-br [-6 13 0])) + +; Offsets for the screw inserts dependent on thumb-style & inner-column +(when (and (= thumb-style "cf") inner-column) + (def screw-offset-bl [13 4 0]) + (def screw-offset-bm [13 -7 0])) +(when (and (= thumb-style "cf") (false? inner-column)) + (def screw-offset-bl [-3.7 2 0]) + (def screw-offset-bm [13 -7 0])) +(when (and (= thumb-style "mini") inner-column) + (def screw-offset-bl [18 8 0]) + (def screw-offset-bm [-1 -7 0])) +(when (and (= thumb-style "mini") (false? inner-column)) + (def screw-offset-bl [2 6 0]) + (def screw-offset-bm [-1 -7 0])) +(when (and (= thumb-style "default") inner-column) + (def screw-offset-bl [9 -6 0]) + (def screw-offset-bm [8 -1 0])) +(when (and (= thumb-style "default") (false? inner-column)) + (def screw-offset-bl [-7.7 -8 0]) + (def screw-offset-bm [8 -1 0])) + (defn screw-insert-all-shapes [bottom-radius top-radius height] (union (screw-insert 0 0 bottom-radius top-radius height [7 6.5 0]) - (screw-insert 0 lastrow bottom-radius top-radius height [13 4 0]) - (screw-insert lastcol lastrow bottom-radius top-radius height [7 14 0]) - (screw-insert lastcol 0 bottom-radius top-radius height [1 7 0]) - (screw-insert (+ 1 innercol-offset) lastrow bottom-radius top-radius height [13 -7 0]))) + (screw-insert 0 lastrow bottom-radius top-radius height screw-offset-bl) + (screw-insert lastcol lastrow bottom-radius top-radius height screw-offset-br) + (screw-insert lastcol 0 bottom-radius top-radius height screw-offset-tr) + (screw-insert (+ 1 innercol-offset) lastrow bottom-radius top-radius height screw-offset-bm))) ; Hole Depth Y: 4.4 (def screw-insert-height 6)