mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2025-09-13 23:59:49 +00:00
Merge branch 'master' into dual_legend
This commit is contained in:
commit
86fab3b4a2
10 changed files with 145 additions and 28 deletions
|
@ -27,7 +27,7 @@ yellow = [1, .6941, .2];
|
|||
transparent_red = [1,0,0, 0.15];
|
||||
|
||||
// key shape including dish. used as the ouside and inside shape in keytop(). allows for itself to be shrunk in depth and width / height
|
||||
module shape(thickness_difference, depth_difference){
|
||||
module shape(thickness_difference, depth_difference=0){
|
||||
dished(depth_difference, $inverted_dish) {
|
||||
color(blue) shape_hull(thickness_difference, depth_difference, $inverted_dish ? 2 : 0);
|
||||
}
|
||||
|
@ -328,6 +328,7 @@ module clearance_check() {
|
|||
}
|
||||
|
||||
module legends(depth=0) {
|
||||
|
||||
if ($legends_dual) {
|
||||
front_placement() {
|
||||
if (len($legends_front) > 0) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
module dcs_row(row=3, column=0) {
|
||||
// names, so I don't go crazy
|
||||
$bottom_key_width = 18.16;
|
||||
$bottom_key_height = 18.16;
|
||||
$width_difference = 6;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
include <../layout.scad>
|
||||
|
||||
// negative numbers are used for spacing
|
||||
gherkin_mapping = [
|
||||
gherkin_default_layout = [
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
|
@ -14,5 +14,5 @@ gherkin_default_legends = [
|
|||
];
|
||||
|
||||
module gherkin_default(profile) {
|
||||
layout(gherkin_mapping, profile, legends=gherkin_default_legends, row_sculpting_offset=1, row_override=3) children();
|
||||
layout(gherkin_default_layout, profile, legends=gherkin_default_legends, row_sculpting_offset=1, row_override=3) children();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ function double_sculpted_column(column, row_length, column_sculpt_profile) =
|
|||
|
||||
module layout(list, profile="dcs", legends=undef, legends_front=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) {
|
||||
for (row = [0:len(list)-1]){
|
||||
echo("**ROW**:", row);
|
||||
/* echo("**ROW**:", row); */
|
||||
row_length = len(list[row]);
|
||||
|
||||
for(column = column_override ? column_override : [0:len(list[row])-1]) {
|
||||
|
@ -31,15 +31,16 @@ module layout(list, profile="dcs", legends=undef, legends_front=undef, row_sculp
|
|||
column_value = double_sculpted_column(column, row_length, column_sculpt_profile);
|
||||
column_distance = abs_sum([for (x = [0 : column]) list[row][x]]);
|
||||
|
||||
echo("\t**COLUMN**", "column_value", column_value, "column_distance", column_distance);
|
||||
/* echo("\t**COLUMN**", "column_value", column_value, "column_distance", column_distance); */
|
||||
|
||||
// supports negative values for nonexistent keys
|
||||
if (key_length >= 1) {
|
||||
translate_u(column_distance - (key_length/2), -row) {
|
||||
|
||||
key_profile(profile, row_sculpting, column_value) u(key_length) legend(legends ? legends[row][column] : "") legend_front(legends_front ? legends_front[row][column] : "") cherry() { // (row+4) % 5 + 1
|
||||
$row = row;
|
||||
$column = column;
|
||||
|
||||
|
||||
if (key_length == 6.25) {
|
||||
spacebar() {
|
||||
if ($children) {
|
||||
|
@ -87,3 +88,37 @@ module layout(list, profile="dcs", legends=undef, legends_front=undef, row_sculp
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
module simple_layout(list) {
|
||||
for (row = [0:len(list)-1]){
|
||||
/* echo("**ROW**:", row); */
|
||||
for(column = [0:len(list[row])-1]) {
|
||||
key_length = list[row][column];
|
||||
column_distance = abs_sum([for (x = [0 : column]) list[row][x]]);
|
||||
|
||||
/* echo("\t**COLUMN**", "column_value", column_value, "column_distance", column_distance); */
|
||||
|
||||
// supports negative values for nonexistent keys
|
||||
if (key_length >= 1) {
|
||||
translate_u(column_distance - (key_length/2), -row) {
|
||||
u(key_length) { // (row+4) % 5 + 1
|
||||
$row = row;
|
||||
$column = column;
|
||||
|
||||
if (key_length == 6.25) {
|
||||
spacebar() children();
|
||||
} else if (key_length == 2.25) {
|
||||
lshift() children();
|
||||
} else if (key_length == 2) {
|
||||
backspace() children();
|
||||
} else if (key_length == 2.75) {
|
||||
rshift() children();
|
||||
} else {
|
||||
children();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,21 @@ include <../layout.scad>
|
|||
// 0's are to make space for a middle row for just the spacebar so that it
|
||||
// isn't sculpted with double sculpting. the 0's in the first three rows
|
||||
// don't _need_ to be there but it's nice to keep track
|
||||
planck_layout_mapping = [
|
||||
planck_default_layout = [
|
||||
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 0, 2, 0, 1, 1, 1, 1, 1]
|
||||
];
|
||||
|
||||
planck_default_legends = [
|
||||
[ "⇥", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "⌫"],
|
||||
["Esc", "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", "⏎"],
|
||||
[ "⇧", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/", "⇧"],
|
||||
[ "Fn", "Ctl", "Alt", "Cmd", "Lwr", "", "", "RSE", "←", "↓", "↑", "→"],
|
||||
];
|
||||
|
||||
|
||||
module planck_default(profile, column_sculpt_profile="2hands") {
|
||||
layout(planck_layout_mapping, profile, row_sculpting_offset=1, column_sculpt_profile=column_sculpt_profile) children();
|
||||
layout(planck_default_layout, profile, row_sculpting_offset=1, column_sculpt_profile=column_sculpt_profile) children();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include <../layout.scad>
|
||||
|
||||
preonic_layout_mapping = [
|
||||
preonic_default_layout = [
|
||||
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1],
|
||||
|
@ -8,6 +8,14 @@ preonic_layout_mapping = [
|
|||
[1, 1, 1, 1, 1, 0, 2, 0, 1, 1, 1, 1, 1]
|
||||
];
|
||||
|
||||
preonic_default_legends = [
|
||||
[ "`", "1", "2", "3", "4", "5", "", "6", "7", "8", "9", "0", "-"],
|
||||
[ "⇥", "Q", "W", "E", "R", "T", "", "Y", "U", "I", "O", "P", "⌫"],
|
||||
["Esc", "A", "S", "D", "F", "G", "", "H", "J", "K", "L", ";", "⏎"],
|
||||
[ "⇧", "Z", "X", "C", "V", "B", "", "N", "M", ",", ".", "/", "⇧"],
|
||||
[ "Fn", "Ctl", "Alt", "Cmd", "Lwr", "", "", "", "RSE", "←", "↓", "↑", "→"],
|
||||
];
|
||||
|
||||
module preonic_default(profile, column_sculpt_profile="2hands") {
|
||||
layout(preonic_layout_mapping, profile, column_sculpt_profile=column_sculpt_profile) children();
|
||||
layout(preonic_default_layout, profile, column_sculpt_profile=column_sculpt_profile) children();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
// TODO make this use layout()
|
||||
module preonic_mit(profile) {
|
||||
for(x = [0:1:4]) {
|
||||
for(y=[-2.5:0.5:3]) {
|
||||
translate_u(y * 2,-x) key_profile(profile, x,floor(y)) {
|
||||
key();
|
||||
}
|
||||
}
|
||||
}
|
||||
include <../layout.scad>
|
||||
|
||||
preonic_mit_layout = [
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
||||
];
|
||||
|
||||
preonic_mit_legends = [
|
||||
[ "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-"],
|
||||
[ "⇥", "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "⌫"],
|
||||
["Esc", "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", "⏎"],
|
||||
[ "⇧", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/", "⇧"],
|
||||
[ "Fn", "Ctl", "Alt", "Cmd", "Lwr", "", "", "RSE", "←", "↓", "↑", "→"],
|
||||
];
|
||||
|
||||
module planck_mit(profile) {
|
||||
layout(preonic_mit_layout, profile, legends=preonic_mit_legends, row_sculpting_offset=1) children();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue