       (write-scad (union
                    key-holes
                    connectors
+                   thumb
+                   thumbcaps
                    caps
-                   thumb
-                  ;  thumbcaps
                   ;  front-wall
                   ;  right-wall
                   ;  new-case

;;;;;;;;;;;;
;; Thumbs ;;
;;;;;;;;;;;;
(def thumborigin [-25 -35 40])

(defn deg2rad [degrees]
  (* (/ degrees 180) pi))

(defn thumb-a1-place [shape]
  (->> shape
       (rotate (deg2rad  10) [1 0 0])
       (rotate (deg2rad -23) [0 1 0])
       (rotate (deg2rad  -3) [0 0 1])
       (translate thumborigin)
       (translate [-16 -23 -3])
       ))
(defn thumb-a2-place [shape]
  (->> shape
       (rotate (deg2rad  15) [1 0 0])
       (rotate (deg2rad -35) [0 1 0])
       (rotate (deg2rad  54) [0 0 1])
       (translate thumborigin)
       (translate [-28 -50 -16])
       ))
(defn thumb-a3-place [shape]
  (->> shape
       (rotate (deg2rad   6) [1 0 0])
       (rotate (deg2rad -34) [0 1 0])
       (rotate (deg2rad  74) [0 0 1])
       (translate thumborigin)
       (translate [-35 -65 -27])))
(defn thumb-b1-place [shape]
  (->> shape
       (rotate (deg2rad  10) [1 0 0])
       (rotate (deg2rad -23) [0 1 0])
       (rotate (deg2rad  -3) [0 0 1])
       (translate thumborigin)
       (translate [-36 -21 -5])))
(defn thumb-b2-place [shape]
  (->> shape
       (rotate (deg2rad   6) [1 0 0])
       (rotate (deg2rad -34) [0 1 0])
       (rotate (deg2rad  70) [0 0 1])
       (translate thumborigin)
       (translate [-51 -34 -16])
       ))
(defn thumb-b3-place [shape]
  (->> shape
       (rotate (deg2rad   3) [1 0 0])
       (rotate (deg2rad -35) [0 1 0])
       (rotate (deg2rad  52) [0 0 1])
       (translate thumborigin)
       (translate [-55 -52 -28])
       ))

(defn thumb-1x-layout [shape]
  (union
   (thumb-a2-place shape)
   (thumb-a3-place shape)
   (thumb-b2-place shape)
   (thumb-b3-place shape)))

(defn thumb-15x-layout [shape]
  (union
   (thumb-a1-place shape)
   (thumb-b1-place shape)))

(def larger-plate
  (let [plate-height (/ (- sa-double-length mount-height) 3)

   (thumb-1x-layout (sa-cap 1))
   (thumb-15x-layout (rotate (/ π 2) [0 0 1] (sa-cap 1.5)))))


(def thumb
  (union
;    thumb-connectors
   (thumb-1x-layout single-plate)
   (thumb-15x-layout single-plate)
   (thumb-15x-layout larger-plate)
