update dsa sculpted profiles, add more groupings for printing redox keys

This commit is contained in:
Myles Metzler 2018-03-11 21:31:07 -04:00
parent b48fb2465e
commit 93ed0aa63e
3 changed files with 107 additions and 57 deletions

View File

@ -16,16 +16,27 @@ include <src/key_types.scad>
include <src/key_transformations.scad> include <src/key_transformations.scad>
//select the keyset profile options are: ["dcs", "oem", "sa", "g20", "dsa"] //select the keyset profile options are: ["dcs", "oem", "sa", "g20", "dsa"]
profile = "oem"; profile = "dsa";
//select weather or not to sculpt the keys by row (you probably want true for dsa only) //select weather or not to sculpt the keys by row (set to true for real dsa keys or they will just be shorter sa keys)
unsculpted = false; unsculpted = false;
//choose if legends are inset or raised above the surface of the keys. //choose if legends are inset or raised above the surface of the keys.
legend_inset = true; legend_inset = true;
//place a home row bump on the F and J keys //place a home row bump on the F and J keys
home_row_bump = true; home_row_bump = true;
//regular legend font size (default is 6)
//$font_size = 6;
//symbol legend font size (symbols being arrows/enter/shift/backspace etc)
sym_size = 10;
//shifted key press font size
alt_size = 4.5;
//multi character font size
word_size = 4;
//used for selecting the profile row in a loop. //used for selecting the profile row in a loop.
rows = [5,1,2,3,4]; //rows = [5,1,2,3,4];
rows = [1,2,3,4,3];
module translate_u(x=0, y=0, z=0){ module translate_u(x=0, y=0, z=0){
translate([x * unit, y*unit, z*unit]) children(); translate([x * unit, y*unit, z*unit]) children();
@ -35,29 +46,25 @@ module keypf(row) {
key_profile(profile, unsculpted ? 3 : row) brimmed(0.25) cherry() key(legend_inset); key_profile(profile, unsculpted ? 3 : row) brimmed(0.25) cherry() key(legend_inset);
} }
module make_keys(keys) { module make_keys(keys, scol=undef, ecol=undef) {
for (i=[0:len(keys)-1]) { ascol = scol == undef ? 0 : scol;
aecol = ecol == undef ? len(keys) - 1 : ecol;
for (i=[ascol:aecol]) {
for (j=[0:len(keys[i])-1]) { for (j=[0:len(keys[i])-1]) {
if ((keys[i][j][0] == "F" || keys[i][j][0] == "J") && home_row_bump && len(keys[i][j]) == 1) if ((keys[i][j][0] == "F" || keys[i][j][0] == "J") && home_row_bump && len(keys[i][j]) == 1)
translate_u(i, -j) legend(keys[i][j][0]) bump() keypf(rows[j]); translate_u(i, -j) legend(keys[i][j][0]) bump() keypf(rows[j]);
else if ((keys[i][j][0] == "F" || keys[i][j][0] == "J") && home_row_bump && len(keys[i][j]) == 2) else if ((keys[i][j][0] == "F" || keys[i][j][0] == "J") && home_row_bump && len(keys[i][j]) == 2)
translate_u(i, -j) legend(keys[i][j][1], "top", "left", 3) legend(keys[i][j][0]) bump() keypf(rows[j]); translate_u(i, -j) legend(keys[i][j][1], "top", size=alt_size) legend(keys[i][j][0], "bottom", size=alt_size) bump() keypf(rows[j]);
else if (len(keys[i][j]) == 1) else if (len(keys[i][j]) == 1)
translate_u(i, -j) legend(keys[i][j][0]) keypf(rows[j]); translate_u(i, -j) legend(keys[i][j][0]) keypf(rows[j]);
else if (len(keys[i][j]) == 2) else if (len(keys[i][j]) == 2)
translate_u(i, -j) legend(keys[i][j][1], "top", "left", 3) legend(keys[i][j][0]) keypf(rows[j]); translate_u(i, -j) legend(keys[i][j][1], "top", size=alt_size) legend(keys[i][j][0], "bottom", size=alt_size) keypf(rows[j]);
} }
} }
} }
module make_1_25_col(keys) {
for (i=[0:len(keys)-1]) {
translate_u(0, -i) 1_25u() legend(keys[i]) keypf(rows[i]);
}
}
//left hand alphanumeric keys //left hand alphanumeric keys
module alphanum_left() { module alphanum_left(scol=undef, ecol=undef) {
keysdef = [ keysdef = [
[["1", "!"], ["Q"], ["A"], ["Z"]], [["1", "!"], ["Q"], ["A"], ["Z"]],
[["2", "@"], ["W"], ["S"], ["X"]], [["2", "@"], ["W"], ["S"], ["X"]],
@ -65,48 +72,66 @@ module alphanum_left() {
[["4", "$"], ["R"], ["F"], ["V"]], [["4", "$"], ["R"], ["F"], ["V"]],
[["5", "%"], ["T"], ["G"], ["B"]] [["5", "%"], ["T"], ["G"], ["B"]]
]; ];
make_keys(keysdef); make_keys(keysdef, scol, ecol);
} }
//left hand 1.25u modifier keys //left hand 1.25u modifier keys
module mod_left_outside() { module mod_left_outside() {
translate_u(-1.125, 0) make_1_25_col(["ESC","TAB","CLK",chr(8657)]); translate_u(-1.125, 0) 1_25u() legend("ESC") keypf(1);
translate_u(-1.125, -1) 1_25u() legend("TAB") keypf(2);
translate_u(-1.125, -2) 1_25u() legend("CLK") keypf(3);
translate_u(-1.125, -3) 1_25u() legend(chr(8657), size=sym_size) keypf(4);
} }
//left hand bottom row modifier keys //left hand bottom row modifier keys
module mod_left_bottom() { module mod_left_bottom(half=undef) {
translate_u(-1, -4) legend("`") legend("~", "top", "left", 3) keypf(4); if (half == undef || half == "left") {
translate_u(0, -4) legend("CTRL", size=4) keypf(4); translate_u(-1, -4) legend("CTRL", size=word_size) keypf(3);
translate_u(1, -4) keypf(4); translate_u(0, -4) legend("LYR", size=word_size) keypf(3);
translate_u(2, -4) legend("ALT", size=4) keypf(4); translate_u(1, -4) legend("GUI", size=word_size) keypf(3);
translate_u(3.125, -4) 1_25u()legend("fn", size=4) keypf(4); translate_u(2, -4) legend("ALT", size=word_size) keypf(3);
}
if (half == undef || half == "right") translate_u(3.125, -4) 1_25u() legend(chr(8657), size=sym_size) keypf(3);
} }
//left hand center modifier keys //left hand center modifier keys
module mod_left_inside() { module mod_left_inside() {
translate_u(5, 0) legend("-") legend("_", "top", "left", 3) keypf(5); translate_u(5, -0.125) 1_25uh() legend("[", "bottom", size=alt_size) legend("{", "top", size=alt_size) keypf(2);
translate_u(5, -1.125) 1_25uh() legend("[") legend("{", "top", "left", 3) keypf(1); translate_u(5, -1.375) 1_25uh() legend("-", "bottom") legend("_", "top") keypf(3);
} }
//left hand thumb cluster modifier keys //left hand thumb cluster modifier keys
module mod_left_thumb() { module mod_left_thumb() {
translate_u(5, -3) legend("HOME", size=4) keypf(3); translate_u(5, -3) legend("", size=word_size) keypf(2);
translate_u(6, -3) legend("END", size=4) keypf(3); translate_u(6, -3) legend(chr(8998), size=sym_size) keypf(2);
translate_u(5, -4.25) 1_5uh() legend(chr(9003)) keypf(3); translate_u(5, -4.25) 1_5uh() keypf(3);
translate_u(6, -4.25) 1_5uh() legend(chr(8998)) keypf(3); translate_u(6, -4.25) 1_5uh() legend(chr(9003), size=sym_size) keypf(3);
} }
//render the entire left hand key set //render the entire left hand key set (or a half of a half for smaller printable groups)
module left() { module left(half=undef) {
if (half == "left") {
alphanum_left(0, 2);
mod_left_outside();
mod_left_bottom("left");
}
else if (half == "right") {
alphanum_left(3, 4);
mod_left_bottom("right");
mod_left_inside();
mod_left_thumb();
}
else {
alphanum_left(); alphanum_left();
mod_left_outside(); mod_left_outside();
mod_left_bottom(); mod_left_bottom();
mod_left_inside(); mod_left_inside();
mod_left_thumb(); mod_left_thumb();
} }
}
//right hand alphanumeric keys //right hand alphanumeric keys
module alphanum_right() { module alphanum_right(scol=undef, ecol=undef) {
keysdef = [ keysdef = [
[["6", "^"], ["Y"], ["H"], ["N"]], [["6", "^"], ["Y"], ["H"], ["N"]],
[["7", "&"], ["U"], ["J"], ["M"]], [["7", "&"], ["U"], ["J"], ["M"]],
@ -114,45 +139,63 @@ module alphanum_right() {
[["9", "("], ["O"], ["L"], [".", ">"]], [["9", "("], ["O"], ["L"], [".", ">"]],
[["0", ")"], ["P"], [";", ":"], ["/", "?"]] [["0", ")"], ["P"], [";", ":"], ["/", "?"]]
]; ];
make_keys(keysdef); make_keys(keysdef, scol, ecol);
} }
//right hand 1.25u modifier keys //right hand 1.25u modifier keys
module mod_right_outside() { module mod_right_outside() {
translate_u(5.125, 0) make_1_25_col([chr(9003),"\\",chr(8629),chr(8657)]); translate_u(5.125, 0) 1_25u() legend(chr(9003), size=sym_size) keypf(1);
translate_u(5.125, -1) 1_25u() legend("\\", "bottom", size=alt_size) legend("|", "top", size=alt_size) keypf(2);
translate_u(5.125, -2) 1_25u() legend("'", "bottom", size=alt_size) legend("\"", "top", size=alt_size) keypf(3);
translate_u(5.125, -3) 1_25u() legend(chr(8657), size=sym_size) keypf(4);
} }
//right hand bottom row modifier keys //right hand bottom row modifier keys
module mod_right_bottom() { module mod_right_bottom(half=undef) {
translate_u(5, -4) legend(chr(9654)) keypf(4); if (half == undef || half == "right") {
translate_u(4, -4) legend(chr(9660)) keypf(4); translate_u(5, -4) legend(chr(9654)) keypf(3);
translate_u(3, -4) legend(chr(9650)) keypf(4); translate_u(4, -4) legend(chr(9660)) keypf(3);
translate_u(2, -4) legend(chr(9664)) keypf(4); translate_u(3, -4) legend(chr(9650)) keypf(3);
translate_u(0.875, -4) 1_25u() legend("fn", size=4) keypf(4); translate_u(2, -4) legend(chr(9664)) keypf(3);
}
if (half == undef || half == "left") translate_u(0.875, -4) 1_25u() legend(chr(8657), size=sym_size) keypf(3);
} }
//right hand center modifier keys //right hand center modifier keys
module mod_right_inside() { module mod_right_inside() {
translate_u(-1, 0) legend("=") legend("+", "top", "left", 3) keypf(1); translate_u(-1, -0.125) 1_25uh() legend("]", "bottom", size=alt_size) legend("}", "top", size=alt_size) keypf(2);
translate_u(-1, -1.125) 1_25uh() legend("]") legend("}", "top", "left", 3) keypf(2); translate_u(-1, -1.375) 1_25uh() legend("=", "bottom") legend("+", "top") keypf(3);
} }
//right hand thum cluster modifier keys //right hand thum cluster modifier keys
module mod_right_thumb() { module mod_right_thumb() {
translate_u(-1, -3) legend("PGDN", size=4) keypf(3); translate_u(-1, -3) legend("PGDN", size=word_size) keypf(2);
translate_u(-2, -3) legend("PGUP", size=4) keypf(3); translate_u(-2, -3) legend("PGUP", size=word_size) keypf(2);
translate_u(-1, -4.25) 1_5uh() keypf(3); translate_u(-1, -4.25) 1_5uh() keypf(3);
translate_u(-2, -4.25) 1_5uh() legend(chr(8629)) keypf(3); translate_u(-2, -4.25) 1_5uh() legend(chr(8629), size=sym_size) keypf(3);
} }
//render entire right hand key set //render entire right hand key set
module right() { module right(half=undef) {
if (half == "left") {
alphanum_right(0, 1);
mod_right_bottom("left");
mod_right_thumb();
mod_right_inside();
}
else if (half == "right") {
alphanum_right(2, 4);
mod_right_outside();
mod_right_bottom("right");
}
else {
alphanum_right(); alphanum_right();
mod_right_outside(); mod_right_outside();
mod_right_bottom(); mod_right_bottom();
mod_right_thumb(); mod_right_thumb();
mod_right_inside(); mod_right_inside();
} }
}
//show entire set //show entire set
@ -161,14 +204,20 @@ module right() {
//individual sections for printing (keep stl output clusters close together for better slicing) //individual sections for printing (keep stl output clusters close together for better slicing)
//left(); //left();
//left("left");
//left("right");
//alphanum_left(); //alphanum_left();
//mod_left_outside(); //mod_left_outside();
//mod_left_bottom(); //mod_left_bottom();
//mod_left_inside(); //mod_left_inside();
//mod_left_thumb(); //mod_left_thumb();
//right(); //right();
//right("left");
//right("right");
//alphanum_right(); //alphanum_right();
//mod_right_outside(); //mod_right_outside();
//mod_right_bottom(); //mod_right_bottom();
//mod_right_thumb(); //mod_right_thumb();
//mod_right_inside(); //mod_right_inside();
//inverted()

View File

@ -1,9 +1,10 @@
module dsa_row(n=3) { module dsa_row(n=3) {
depth_raisers = [0, 3.5, 1, 0, 1, 3];
$bottom_key_width = 18.24; // 18.4; $bottom_key_width = 18.24; // 18.4;
$bottom_key_height = 18.24; // 18.4; $bottom_key_height = 18.24; // 18.4;
$width_difference = 6; // 5.7; $width_difference = 6; // 5.7;
$height_difference = 6; // 5.7; $height_difference = 6; // 5.7;
$total_depth = 8.1 + abs((n-3) * 1); $total_depth = 8.1 + depth_raisers[n];
$top_tilt = n == 5 ? -21 : (n-3) * 7; $top_tilt = n == 5 ? -21 : (n-3) * 7;
$top_skew = 0; $top_skew = 0;
$dish_type = "spherical"; $dish_type = "spherical";

View File

@ -117,7 +117,7 @@ $legends = [];
//insert locating bump //insert locating bump
$key_bump = false; $key_bump = false;
//height of the location bump from the top surface of the key //height of the location bump from the top surface of the key
$key_bump_depth = 0.3; $key_bump_depth = 0.5;
//distance to move the bump from the front edge of the key //distance to move the bump from the front edge of the key
$key_bump_edge = 0.4; $key_bump_edge = 0.4;