]> git.armaanb.net Git - atreides.git/commitdiff
OpenSCAD design with (optional) 2 thumb keys per hand.
authorConstantine Khroulev <ckhroulev@alaska.edu>
Fri, 16 May 2014 00:31:44 +0000 (16:31 -0800)
committerConstantine Khroulev <ckhroulev@alaska.edu>
Fri, 16 May 2014 00:31:44 +0000 (16:31 -0800)
case/openscad/atreus_case.scad

index 7ba69786d32c664cd5d9704d61dbec0fa1bef3ba..9c9791e5d382851ab97a2f8b30b885dcc3c33e95 100644 (file)
@@ -47,6 +47,9 @@ use_notched_holes = true;
 n_rows = 4;
 n_cols = 5;
 
+/* Number of thumb keys (per hand), try 1 or 2. */
+n_thumb_keys = 1;
+
 /* The width of the USB cable hole in the spacer. */
 cable_hole_width = 4;
 
@@ -155,13 +158,15 @@ module right_half (switch_holes=true, key_size=key_hole_size) {
   thumb_key_offset = y_offset + 0.5 * column_spacing;
   rotate_half() {
     add_hand_separation() {
-      if (switch_holes == true) {
-        switch_hole([x_offset, thumb_key_offset]);
-      } else {
-        thumb_key([x_offset, thumb_key_offset], key_size);
+      for (j=[0:(n_thumb_keys-1)]) {
+        if (switch_holes == true) {
+          switch_hole([x_offset + j*row_spacing, thumb_key_offset]);
+        } else {
+          thumb_key([x_offset + j*row_spacing, thumb_key_offset], key_size);
+        }
       }
       for (j=[0:(n_cols-1)]) {
-        column([x_offset + (j+1)*row_spacing, y_offset + staggering_offsets[j]], switch_holes, key_size);
+        column([x_offset + (j+n_thumb_keys)*row_spacing, y_offset + staggering_offsets[j]], switch_holes, key_size);
       }
     }
   }
@@ -189,7 +194,7 @@ module screw_hole(radius, offset_radius, position, direction) {
 
 module right_screw_holes(hole_radius) {
   /* coordinates of the back right screw hole before rotation... */
-  back_right = [(n_cols+1)*row_spacing,
+  back_right = [(n_cols+n_thumb_keys)*row_spacing,
                staggering_offsets[n_cols-1] + n_rows * column_spacing];
   /* and after */
   tmp = rz_fun(back_right, angle, [0, 2.25*column_spacing]);
@@ -202,7 +207,7 @@ module right_screw_holes(hole_radius) {
                  [row_spacing, 0],
                  [-nudge, -nudge]);
       screw_hole(hole_radius, washer_radius,
-                 [(n_cols+1)*row_spacing, staggering_offsets[n_cols-1]],
+                 [(n_cols+n_thumb_keys)*row_spacing, staggering_offsets[n_cols-1]],
                  [nudge, -nudge]);
       screw_hole(hole_radius, washer_radius,
                  back_right,