summaryrefslogtreecommitdiff
path: root/src/dactyl_keyboard
diff options
context:
space:
mode:
authorTom Short <tshort.rlists@gmail.com>2017-03-11 11:27:47 -0500
committerTom Short <tshort.rlists@gmail.com>2017-03-11 11:27:47 -0500
commit89d5a7430f92e6b8f2ddfbb383bde01aab02de02 (patch)
tree9a03b4f4b9f6cc9c0e1816f9a953af51fb29740b /src/dactyl_keyboard
parent2e2d55f70a96d91d4e77406cf3677e1be0f4c099 (diff)
Tweak hex-spacer
Diffstat (limited to 'src/dactyl_keyboard')
-rw-r--r--src/dactyl_keyboard/dactyl.clj25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/dactyl_keyboard/dactyl.clj b/src/dactyl_keyboard/dactyl.clj
index 1a99bac..36bb1c8 100644
--- a/src/dactyl_keyboard/dactyl.clj
+++ b/src/dactyl_keyboard/dactyl.clj
@@ -563,7 +563,7 @@
(on-wall-place 0 20))))
-(defn hex-spacer [column row radius]
+(defn hex-spacer [column row radius height]
(let [position (key-position column row [0 0 0])
column-offset (/ mount-width 2)
row-offset (/ mount-height 2)
@@ -573,14 +573,10 @@
shift-down (and (not (or shift-right shift-left)) (= row lastrow))
is-vertical (or shift-left shift-right)
col-angle (+ (* β (- centercol column)) (/ π 12))
- row-angle (* α (- row centerrow))
- height 10]
+ row-angle (* α (- row centerrow))]
(->> (cylinder radius height)
(rotate (if is-vertical (/ π 6) 0) [0 0 1])
(translate [(first position) (second position) (/ height 2)])
- ; (translate [(* (if shift-right 1 (if shift-left -1 0)) (- column-offset (* wall-offset (Math/abs (Math/sin col-angle)))))
- ; (* (if shift-up 1 (if shift-down -1 0)) (- row-offset (* wall-offset (Math/abs (Math/sin row-angle)))))
- ; 0])
(translate [(* (if shift-right 1 (if shift-left -1 0)) column-offset)
(* (if shift-up 1 (if shift-down -1 0)) row-offset)
0])
@@ -589,16 +585,17 @@
0])
(with-fn 6))))
-(defn hex-spacer-shapes [radius]
- (union (hex-spacer 0 0 radius)
- (hex-spacer 0 cornerrow radius)
- (hex-spacer 3 lastrow radius)
- (hex-spacer 2 0 radius)
- (hex-spacer lastcol (dec cornerrow) radius)
+(defn hex-spacer-shapes [radius height]
+ (union (hex-spacer 0 0 radius height)
+ (hex-spacer 0 cornerrow radius height)
+ (hex-spacer 3 lastrow radius height)
+ (hex-spacer 2 0 radius height)
+ (hex-spacer lastcol (dec cornerrow) radius height)
))
+(def hex-spacer-height 10)
(def hex-spacer-radius (/ 5.42 2))
-(def hex-spacer-holes (hex-spacer-shapes hex-spacer-radius))
-(def hex-spacer-outers (hex-spacer-shapes (+ hex-spacer-radius 1.6)))
+(def hex-spacer-holes (hex-spacer-shapes hex-spacer-radius hex-spacer-height))
+(def hex-spacer-outers (hex-spacer-shapes (+ hex-spacer-radius 1.6) (+ hex-spacer-height 1.6)))
;; teensy info