/ examples / sa_ergo.scad
sa_ergo.scad
 1  include <../includes.scad>
 2  
 3  /*
 4  In this example, we harness full sculpting and simple_layout to make a set of SA
 5  keys that look a lot like the key wells on a dactyl, dactyl manuform, or kinesis
 6  
 7  SA keys render faster with skin_extrude_shape = true, but then they don't get
 8  the nice flaring on the sides... yet.
 9  */
10  
11  // to turn on full sculpting
12  $double_sculpted = true;
13  // to make the font fit
14  $font_size = 4;
15  
16  // change this to make the full sculpting more or less aggressive. 200 is default
17  $double_sculpt_radius = 200;
18  
19  // This is the exact column stagger from the dactyl transposed onto the
20  // rows of the preonic default layout. the second array is for modifying the
21  // values up or down - making all the 0's -1's would make each key 1mm lower
22  // for instance. I'd suggest going as low as you can without cutting off any stems
23  extra_column_height = [5.64, 5.64, 0, -3, 0, 0, 0, 0, 0, -3, 0, 5.64, 5.64] + [0,0,0,0,0,0,0,0,0,0,0,0,0];
24  // required for double_sculpted_column
25  row_length = len(preonic_default_layout[0]);
26  
27  simple_layout(preonic_default_layout) {
28    // this union is here because, for some reason, you cannot modify special variables
29    // that are modified in the scope directly above.
30    union() {
31      // row declarations treat column 0 as perfectly center, so if we just used
32      // $column we'd have a ridiculously looking left-leaning keyboard.
33      // this function transforms the actual column value into a "2hands" column
34      // value, aka for a board with 2 "keywells", one for each hand
35      column_value = double_sculpted_column($column, row_length, "2hands");
36      /* echo("column value", column_value); */
37      sa_row($row+1, column_value){
38        // uh oh, now I need two of them...
39        union() {
40          // uncomment when prototyping for faster prototypes!
41          /* $dish_type = "disable"; */
42          /* $stem_support_type = "disable"; */
43  
44          // here's where the magic happens and we actually add the extra column height
45          $total_depth = $total_depth + extra_column_height[$column];
46          key();
47  
48          // this generates separate legends for the keys
49          /* legend(preonic_default_legends[$row][$column]) legends(); */
50        }
51      }
52    }
53  }