KeyV2/examples/sa_ergo.scad

54 lines
2.1 KiB
OpenSCAD
Raw Normal View History

2020-02-23 02:11:33 +00:00
include <../includes.scad>
2020-02-23 02:21:48 +00:00
/*
In this example, we harness full sculpting and simple_layout to make a set of SA
keys that look a lot like the key wells on a dactyl, dactyl manuform, or kinesis
SA keys render faster with skin_extrude_shape = true, but then they don't get
the nice flaring on the sides... yet.
*/
2020-02-23 02:11:33 +00:00
2020-02-23 02:21:48 +00:00
// to turn on full sculpting
$double_sculpted = true;
// to make the font fit
2020-02-23 02:11:33 +00:00
$font_size = 4;
2020-02-23 02:21:48 +00:00
// change this to make the full sculpting more or less aggressive. 200 is default
$double_sculpt_radius = 200;
// This is the exact column stagger from the dactyl transposed onto the
// rows of the preonic default layout. the second array is for modifying the
// values up or down - making all the 0's -1's would make each key 1mm lower
2020-02-23 02:44:59 +00:00
// for instance. I'd suggest going as low as you can without cutting off any stems
2020-02-23 02:11:33 +00:00
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];
2020-02-23 02:21:48 +00:00
// required for double_sculpted_column
2020-02-23 02:11:33 +00:00
row_length = len(preonic_default_layout[0]);
simple_layout(preonic_default_layout) {
2020-02-23 02:21:48 +00:00
// this union is here because, for some reason, you cannot modify special variables
// that are modified in the scope directly above.
2020-02-23 02:11:33 +00:00
union() {
2020-02-23 02:21:48 +00:00
// row declarations treat column 0 as perfectly center, so if we just used
// $column we'd have a ridiculously looking left-leaning keyboard.
// this function transforms the actual column value into a "2hands" column
// value, aka for a board with 2 "keywells", one for each hand
2020-02-23 02:11:33 +00:00
column_value = double_sculpted_column($column, row_length, "2hands");
2020-02-23 02:21:48 +00:00
/* echo("column value", column_value); */
2020-02-23 02:11:33 +00:00
sa_row($row+1, column_value){
2020-02-23 02:21:48 +00:00
// uh oh, now I need two of them...
2020-02-23 02:11:33 +00:00
union() {
2020-02-23 02:21:48 +00:00
// uncomment when prototyping for faster prototypes!
2020-02-23 02:11:33 +00:00
/* $dish_type = "disable"; */
/* $stem_support_type = "disable"; */
2020-02-23 02:21:48 +00:00
// here's where the magic happens and we actually add the extra column height
2020-02-23 02:11:33 +00:00
$total_depth = $total_depth + extra_column_height[$column];
2020-02-23 02:21:48 +00:00
key();
// this generates separate legends for the keys
2020-02-23 02:28:11 +00:00
/* legend(preonic_default_legends[$row][$column]) legends(); */
2020-02-23 02:11:33 +00:00
}
}
}
}