diff --git a/project.clj b/project.clj index 37de03d..b4cf5c0 100644 --- a/project.clj +++ b/project.clj @@ -14,7 +14,8 @@ :plugins [[lein-exec "0.3.7"] [lein-auto "0.1.3"] [lein-ring "0.12.5"] - [cider/cider-nrepl "0.24.0"]] + [cider/cider-nrepl "0.24.0"] + [lein-cljfmt "0.7.0"]] :aliases {"generate-lightcycle" ["exec" "-p" "src/dactyl_keyboard/lightcycle.clj"] "generate-manuform" ["exec" "-p" "src/dactyl_keyboard/manuform.clj"]} :ring {:handler dactyl-keyboard.handler/app diff --git a/src/dactyl_keyboard/lightcycle.clj b/src/dactyl_keyboard/lightcycle.clj index 6268152..4e2a3d1 100644 --- a/src/dactyl_keyboard/lightcycle.clj +++ b/src/dactyl_keyboard/lightcycle.clj @@ -116,8 +116,7 @@ hide-pinky (fn [column row] (not (and use-lastrow? hide-last-pinky? - (last-pinky-location column row)))) - ] + (last-pinky-location column row))))] (apply union (for [column columns row rows @@ -342,7 +341,7 @@ (translate [0 (- (extended-plate-height %)) 0]))] ;;Connecting main thumb keys. (union - (case thumb-count + (case thumb-count :eight (union (triangle-hulls (thumb-place c 0 0 (thumb-bl 1)) (thumb-place c 1 0 (thumb-br 1)) @@ -365,7 +364,7 @@ (thumb-place c 0 0 (thumb-bl 1)) (thumb-place c 1 0 (thumb-br 1)))) (triangle-hulls #_(thumb-place c 1 -1/2 (thumb-tl 2)) - (thumb-place c 0 -1/2 (thumb-bl 2)) + (thumb-place c 0 -1/2 (thumb-bl 2)) (thumb-place c 1 -1/2 (thumb-br 2)) (thumb-place c 0 -1/2 (thumb-tl 2)) (thumb-place c 1 -1/2 (thumb-tr 2)) @@ -564,7 +563,7 @@ (let [thickness (if thick-wall? 2 1)] (->> (sphere thickness) (translate coords) - (with-fn wall-sphere-n) ))) + (with-fn wall-sphere-n)))) (defn scale-to-range [start end x] (+ start (* (- end start) x))) diff --git a/src/dactyl_keyboard/manuform.clj b/src/dactyl_keyboard/manuform.clj index ad50e4a..433536d 100644 --- a/src/dactyl_keyboard/manuform.clj +++ b/src/dactyl_keyboard/manuform.clj @@ -68,6 +68,8 @@ ; this is the function that puts the key switch holes ; based on the row and the column. + + (defn key-place "Puts the keys' shape to its place based on it's column and row." [c column row shape] @@ -136,8 +138,7 @@ hide-pinky (fn [column row] (not (and (= last-row-count :full) hide-last-pinky? - (last-pinky-location column row)))) - ] + (last-pinky-location column row))))] (apply union (for [column (if use-inner-column? (range -1 ncols) (columns ncols)) @@ -200,8 +201,7 @@ hide-pinky (fn [column row] (not (and (= last-row-count :full) hide-last-pinky? - (last-pinky-location column row)))) - ] + (last-pinky-location column row))))] (union (apply union @@ -317,7 +317,7 @@ x-rotation (if (= thumb-count :five) 10 -6) y-rotation (if (= thumb-count :five) -23 -34) z-rotation (if (= thumb-count :five) 25 48) - movement (if (= thumb-count :five) [-23 -34 -6] [-29 -40 -13]) ] + movement (if (= thumb-count :five) [-23 -34 -6] [-29 -40 -13])] (->> shape (rotate (deg2rad x-rotation) [1 0 0]) (rotate (deg2rad y-rotation) [0 1 0]) @@ -355,11 +355,11 @@ z-rotation (if (= thumb-count :five) 35 52) movement (if (= thumb-count :five) [-51 -25 -11.5] [-56.3 -43.3 -23.5])] (->> shape - (rotate (deg2rad x-rotation) [1 0 0]) - (rotate (deg2rad y-rotation) [0 1 0]) - (rotate (deg2rad z-rotation) [0 0 1]) - (translate (thumborigin c)) - (translate movement)))) + (rotate (deg2rad x-rotation) [1 0 0]) + (rotate (deg2rad y-rotation) [0 1 0]) + (rotate (deg2rad z-rotation) [0 0 1]) + (translate (thumborigin c)) + (translate movement)))) (defn thumb-1x-layout [c shape] (let [thumb-count (get c :configuration-thumb-count)] @@ -449,7 +449,7 @@ (key-place c 2 cornerrow web-post-bl) (key-place c 2 lastrow web-post-tr) (key-place c 2 cornerrow web-post-br) - (key-place c 3 cornerrow web-post-bl)) ))) + (key-place c 3 cornerrow web-post-bl))))) (defn thumb-connector-three [c] (let [row-count (get c :configuration-last-row-count) @@ -862,7 +862,7 @@ lastrow (flastrow nrows) cornerrow (fcornerrow nrows) row-count (get c :configuration-last-row-count) - thumb-tr-post (if (= (get c :configuration-thumb-count) :five ) web-post-br thumb-post-br)] + thumb-tr-post (if (= (get c :configuration-thumb-count) :five) web-post-br thumb-post-br)] (union (wall-brace (partial thumb-tr-place c) 0 -1 thumb-tr-post (partial (partial key-place c) 3 (case row-count :zero cornerrow lastrow)) 0 -1 web-post-bl) @@ -1156,7 +1156,7 @@ 5 -1 6 -2 -3)] - ( key-position c 1 0 (map - (wall-locate2 0 y-addition) [0 (/ mount-height 2) 0])))) + (key-position c 1 0 (map - (wall-locate2 0 y-addition) [0 (/ mount-height 2) 0])))) (defn trrs-usb-holder-position [c] (map + [17 19.3 0] [(first (trrs-usb-holder-ref c)) (second (trrs-usb-holder-ref c)) 2])) @@ -1440,7 +1440,6 @@ screw-insert-outers) (translate [0 0 -10] screw-insert-screw-holes)))))) - #_(spit "things/left.scad" (write-scad (mirror [-1 0 0] model-right)))