From d99887bf6d1d9f0a130cfe6b23644a4941f98ff4 Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Sun, 28 Feb 2021 05:31:06 -0600 Subject: [PATCH 01/13] add alignment tool --- includes.scad | 1 + src/alignment_tool.scad | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/alignment_tool.scad diff --git a/includes.scad b/includes.scad index abb077f..fe0ae05 100644 --- a/includes.scad +++ b/includes.scad @@ -7,3 +7,4 @@ include include include include +include diff --git a/src/alignment_tool.scad b/src/alignment_tool.scad new file mode 100644 index 0000000..4507e9e --- /dev/null +++ b/src/alignment_tool.scad @@ -0,0 +1,15 @@ +include <./includes.scad> + +// Tool for keeping switches aligned while soldering +// Keep the bar high enough that when the keyboard is upside down the switches can be fully depressed + +module alignment_tool(layout=[[1,1,1,1,1]], bar_height=$stem_throw*1.2) { + bar_width=unit/2; + simple_layout(layout) + stem($stem_type, $stem_throw, $stem_slop, $stem_throw); + hull() { + simple_layout(layout) + translate([-unit/2,-bar_width/2,$stem_throw]) + cube([unit,bar_width,bar_height]); + } +} From b02eedc144af32449824b71013822170eee1d5be Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Mon, 15 Mar 2021 12:38:39 -0500 Subject: [PATCH 02/13] initial numpad layout --- src/layouts/numpad/default.scad | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/layouts/numpad/default.scad diff --git a/src/layouts/numpad/default.scad b/src/layouts/numpad/default.scad new file mode 100644 index 0000000..da22c88 --- /dev/null +++ b/src/layouts/numpad/default.scad @@ -0,0 +1,52 @@ +include <../layout.scad> + +// incomplete + +// how to make tall enter key? +// how to auto scale text? + + +numpad_default_layout = [ + [1,1,1,1], + [1,1,1,1], + [1,1,1,1], + [1,1,1,-1], + [2,1,-1] +]; + +numpad_top_row_layout =[ + [1,1,1,1], +]; + +numpad_top_row_legends = [ + ["", "", "", "",], +]; + +numpad_default_legends = [ + ["num", "/", "*", "bksp", ], + ["7", "8", "9", "-",], + ["4", "5", "6", "+",], + ["1", "2", "3", ], + ["0", ".",], +]; + +numpad_default_front_legends = [ + ["", "", "", "", ], + ["home", "\u2191", "pg up", "",], + ["\u2190", "", "\u2192", "",], + ["end", "\u2193", "pg down"], + ["ins", "del",], +]; + + + +module numpad_default(profile) { + + layout(numpad_default_layout, profile, numpad_default_legends, numpad_default_front_legends) children(); + + translate_u(0,1.25) // this is not accurate + layout(numpad_top_row_layout, profile, numpad_top_row_legends) children(); + + translate_u(3,-3.5) + layout([[1,],], profile, [["\u2386",]], row_override=3) numpad_enter() children(); +} From cc5de229a7d6e259d9f0866c516486ec735e3777 Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 11:12:47 -0500 Subject: [PATCH 03/13] iracing pad --- keys.scad | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 173 insertions(+), 2 deletions(-) diff --git a/keys.scad b/keys.scad index 768110e..bc8842a 100644 --- a/keys.scad +++ b/keys.scad @@ -7,9 +7,27 @@ include <./includes.scad> +module item(text) { + legend(text, [0,0], size=4) + children(); +} + +module next() { + legend("next", [0,-0.5], size=3) + children(); +} + +module prev() { + legend("-", [0,0.5], size=8) + children(); +} + // example key -dcs_row(5) legend("⇪", size=9) key(); +//dcs_row(5) item("LAP") key(); + + +//numpad_iracing("dcs")key(); // example row /* for (x = [0:1:4]) { @@ -17,4 +35,157 @@ dcs_row(5) legend("⇪", size=9) key(); } */ // example layout -/* preonic_default("dcs"); */ \ No newline at end of file +/* preonic_default("dcs"); */ + + +numpad_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] +]; + +numpad_top_row_layout =[ + [1,1,1,1], +]; + +numpad_top_row_legends = [ + ["CAM", "CAR", "LAP", "INC", ], +]; + +$font_size=4; + +numpad_default_legends = [ + ["CAM", "CAR", "LAP", "INC",], + ["\u23EA", "\u25B6", "\u23E9", "SLO",], + ["FRM", "\u2191", "FRM", "ME"], + ["\u2190", "\u2193", "\u2192", "TOOL"], + ["CTL", "ALT", "SCR", "UI",], +]; + +// for media controls +//$font="Noto Sans Symbols2"; +//$font="DejaVu Sans"; + +numpad_default_front_legends = [ + ["SUB", "DRV", "FOV", "STEP", ], +]; + +$font="Noto Sans:style=bold"; + +module three_letters(text) { + legend(text,size=3) + children(); +} + +module plus_text(text) { + legend(text,[0,0.7],size=3.4) + children(); +} +module plus() { + $font="Noto Sans Symbols2"; + legend("\u2B9D",[0,-0.7],size=5) + children(); +} + +module minus_text(text) { + legend(text,[0,-0.7],size=3.4) + children(); +} +module minus() { + $font="Noto Sans Symbols2"; + legend("\u2B9F",[0,0.7],size=5) + children(); +} + +module unicode(text) { + $font="Noto Sans Symbols2"; + legend(text,size=8) + children(); +} + +module front(text) { + front_legend(text,[0,-0.5],size=3) + children(); +} + +module frame() { + legend("FRAME", size=2) + children(); +} + +// RENDER stl +module foo() { + echo(0); +} + + +layout_children(numpad_default_layout) { + //["SUB", "DRV", "FOV", "STEP", ], + intersection() { + front("SUB")plus_text("CAM") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("DRV")plus_text("CAR") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("FOV")plus_text("LAP") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("STEP")plus_text("INC") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + + intersection() { + front("SUB")minus_text("CAM") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("DRV")minus_text("CAR") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("FOV")minus_text("LAP") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("STEP")minus_text("INC") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + + + + //["\u23EA", "\u25B6", "\u23E9", "SLO",], + + unicode("\u23EA") dcs_row(1) key(); + unicode("\u25B6") bump() dcs_row(1) key(); + unicode("\u23E9") dcs_row(1) key(); + legend("SLOW", [0,-0.5], size=2.5) legend("MO", [0,0.5], size=2.5) dcs_row(1) key(); + + + unicode("\u23EE") dcs_row(2) key(); + // UTF-32BE dec from unicode-table.com + unicode(chr(129153)) dcs_row(2) key(); // https://unicode-table.com/en/1F881/ + unicode("\u23ED") dcs_row(2) key(); + legend("ME",size=5) dcs_row(2) key(); + + unicode(chr(129152)) dcs_row(3) key(); // https://unicode-table.com/en/1F880/ + unicode(chr(129155)) dcs_row(3) key(); // https://unicode-table.com/en/1F883/ + unicode(chr(129154)) dcs_row(3) key(); // https://unicode-table.com/en/1F882/ + legend("CAM", [0,-0.5], size=3) legend("TOOL", [0,0.5], size=2.5) dcs_row(3) key(); + + front_legend("CTRL") dcs_row(4) key(); + front_legend("ALT") dcs_row(4) key(); + legend("PRINT", [0,-0.5], size=2.5) legend("SCREEN", [0,0.5], size=2) dcs_row(4) key(); + front_legend("MOD") + legend("UI",size=6) dcs_row(4) key(); + + //["CTL", "ALT", "SCR", "UI",], + + +}; From 68f1ffe21ee953688161312414ddd4bbb48eec85 Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 11:13:02 -0500 Subject: [PATCH 04/13] layout_children function --- src/key_layouts.scad | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/key_layouts.scad b/src/key_layouts.scad index 10b5630..6249717 100644 --- a/src/key_layouts.scad +++ b/src/key_layouts.scad @@ -17,4 +17,9 @@ include include include +include +include + + + include From b534329c1dc262d222f0e7a52d83c002fdfafc5c Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 11:20:37 -0500 Subject: [PATCH 05/13] cleanup iracing --- keys.scad | 186 +++++++++++++++++------------------------------------- 1 file changed, 59 insertions(+), 127 deletions(-) diff --git a/keys.scad b/keys.scad index bc8842a..395e077 100644 --- a/keys.scad +++ b/keys.scad @@ -7,37 +7,6 @@ include <./includes.scad> -module item(text) { - legend(text, [0,0], size=4) - children(); -} - -module next() { - legend("next", [0,-0.5], size=3) - children(); -} - -module prev() { - legend("-", [0,0.5], size=8) - children(); -} - - -// example key -//dcs_row(5) item("LAP") key(); - - -//numpad_iracing("dcs")key(); - -// example row -/* for (x = [0:1:4]) { - translate_u(0,-x) dcs_row(x) key(); -} */ - -// example layout -/* preonic_default("dcs"); */ - - numpad_default_layout = [ [1,1,1,1], [1,1,1,1], @@ -47,32 +16,7 @@ numpad_default_layout = [ [1,1,1,1] ]; -numpad_top_row_layout =[ - [1,1,1,1], -]; - -numpad_top_row_legends = [ - ["CAM", "CAR", "LAP", "INC", ], -]; - $font_size=4; - -numpad_default_legends = [ - ["CAM", "CAR", "LAP", "INC",], - ["\u23EA", "\u25B6", "\u23E9", "SLO",], - ["FRM", "\u2191", "FRM", "ME"], - ["\u2190", "\u2193", "\u2192", "TOOL"], - ["CTL", "ALT", "SCR", "UI",], -]; - -// for media controls -//$font="Noto Sans Symbols2"; -//$font="DejaVu Sans"; - -numpad_default_front_legends = [ - ["SUB", "DRV", "FOV", "STEP", ], -]; - $font="Noto Sans:style=bold"; module three_letters(text) { @@ -111,81 +55,69 @@ module front(text) { children(); } -module frame() { - legend("FRAME", size=2) - children(); -} - // RENDER stl module foo() { + // This will silence my auto rendering script echo(0); } +module numpad_iracing() { + layout_children(numpad_default_layout) { + intersection() { + front("SUB")plus_text("CAM") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("DRV")plus_text("CAR") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("FOV")plus_text("LAP") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("STEP")plus_text("INC") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + + intersection() { + front("SUB")minus_text("CAM") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("DRV")minus_text("CAR") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("FOV")minus_text("LAP") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("STEP")minus_text("INC") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + + unicode("\u23EA") dcs_row(1) key(); + unicode("\u25B6") bump() dcs_row(1) key(); + unicode("\u23E9") dcs_row(1) key(); + legend("SLOW", [0,-0.5], size=2.5) legend("MO", [0,0.5], size=2.5) dcs_row(1) key(); -layout_children(numpad_default_layout) { - //["SUB", "DRV", "FOV", "STEP", ], - intersection() { - front("SUB")plus_text("CAM") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("DRV")plus_text("CAR") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("FOV")plus_text("LAP") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("STEP")plus_text("INC") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - - intersection() { - front("SUB")minus_text("CAM") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("DRV")minus_text("CAR") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("FOV")minus_text("LAP") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("STEP")minus_text("INC") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - - - - //["\u23EA", "\u25B6", "\u23E9", "SLO",], - - unicode("\u23EA") dcs_row(1) key(); - unicode("\u25B6") bump() dcs_row(1) key(); - unicode("\u23E9") dcs_row(1) key(); - legend("SLOW", [0,-0.5], size=2.5) legend("MO", [0,0.5], size=2.5) dcs_row(1) key(); - - - unicode("\u23EE") dcs_row(2) key(); - // UTF-32BE dec from unicode-table.com - unicode(chr(129153)) dcs_row(2) key(); // https://unicode-table.com/en/1F881/ - unicode("\u23ED") dcs_row(2) key(); - legend("ME",size=5) dcs_row(2) key(); - - unicode(chr(129152)) dcs_row(3) key(); // https://unicode-table.com/en/1F880/ - unicode(chr(129155)) dcs_row(3) key(); // https://unicode-table.com/en/1F883/ - unicode(chr(129154)) dcs_row(3) key(); // https://unicode-table.com/en/1F882/ - legend("CAM", [0,-0.5], size=3) legend("TOOL", [0,0.5], size=2.5) dcs_row(3) key(); - - front_legend("CTRL") dcs_row(4) key(); - front_legend("ALT") dcs_row(4) key(); - legend("PRINT", [0,-0.5], size=2.5) legend("SCREEN", [0,0.5], size=2) dcs_row(4) key(); - front_legend("MOD") - legend("UI",size=6) dcs_row(4) key(); - - //["CTL", "ALT", "SCR", "UI",], - - + + unicode("\u23EE") dcs_row(2) key(); + unicode(chr(129153)) dcs_row(2) key(); // https://unicode-table.com/en/1F881/ + unicode("\u23ED") dcs_row(2) key(); + legend("ME",size=5) dcs_row(2) key(); + + unicode(chr(129152)) dcs_row(3) key(); // https://unicode-table.com/en/1F880/ + unicode(chr(129155)) dcs_row(3) key(); // https://unicode-table.com/en/1F883/ + unicode(chr(129154)) dcs_row(3) key(); // https://unicode-table.com/en/1F882/ + legend("CAM", [0,-0.5], size=3) legend("TOOL", [0,0.5], size=2.5) dcs_row(3) key(); + + front_legend("CTRL") dcs_row(4) key(); + front_legend("ALT") dcs_row(4) key(); + legend("PRINT", [0,-0.5], size=2.5) legend("SCREEN", [0,0.5], size=2) dcs_row(4) key(); + front_legend("MOD") + legend("UI",size=6) dcs_row(4) key(); + + }; }; From fa33da6dcd5be0e3068498fe5d350bccea54b0ef Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 11:21:32 -0500 Subject: [PATCH 06/13] children layouts --- src/layouts/layout.scad | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/layouts/layout.scad b/src/layouts/layout.scad index cd3c9c2..7019a6d 100644 --- a/src/layouts/layout.scad +++ b/src/layouts/layout.scad @@ -5,6 +5,24 @@ function abs_sum(list, x=0) = x + abs(list[0]) : abs_sum([for (x = [1: len(list) - 1]) list[x]], x+abs(list[0])); +function row(list, n, count=0, row=0, col=0) = + count == n ? + row : + col >= len(list[row]) - 1 ? + row(list, n, count+1, row+1, 0) : + row(list, n, count+1, row, col+1); + +function col(list, n, count=0, row=0, col=0) = + count == n ? + col : + col >= len(list[row]) - 1 ? + col(list, n, count+1, row+1, 0) : + col(list, n, count+1, row, col+1); + + + + + function 2hands(index, total) = ((index+0.5) % (total/2)) - (total/4); function cresting_wave(index, total, mod=4) = (index < total/2) ? (((index + 0.5) / total)*mod) : -(mod - ((index + 0.5) / total * mod)); function 1hand(index, total) = (index % (total)) - (total/2); @@ -20,7 +38,7 @@ function double_sculpted_column(column, row_length, column_sculpt_profile) = 1hand(column, row_length) : (column_sculpt_profile == "cresting_wave") ? cresting_wave(column, row_length) : 0; -module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) { +module layout(list, profile="dcs", legends=undef, front_legends=undef, children_overrides=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) { for (row = [0:len(list)-1]){ /* echo("**ROW**:", row); */ row_length = len(list[row]); @@ -127,3 +145,18 @@ module simple_layout(list) { } } } + +//function count_position(row,column) + +module layout_children(list, items) { + for (n=[0:1:$children-1]){ + row = row(list,n); + column = col(list,n); + echo(row=row); + echo(column=column); + key_length = list[row][column]; + column_distance = abs_sum([for (x = [0 : column]) list[row][x]]); + translate_u(column_distance - (key_length/2), -row) + children(n); + } +} From 4ecbbeb97d8dcae283ee7d6bde374d31399f3966 Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 11:24:01 -0500 Subject: [PATCH 07/13] moved iracing to layouts --- keys.scad | 114 +---------------------------- src/layouts/numpad/iracing.scad | 123 ++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+), 113 deletions(-) create mode 100644 src/layouts/numpad/iracing.scad diff --git a/keys.scad b/keys.scad index 395e077..44a390d 100644 --- a/keys.scad +++ b/keys.scad @@ -7,117 +7,5 @@ include <./includes.scad> -numpad_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] -]; +numpad_iracing(); -$font_size=4; -$font="Noto Sans:style=bold"; - -module three_letters(text) { - legend(text,size=3) - children(); -} - -module plus_text(text) { - legend(text,[0,0.7],size=3.4) - children(); -} -module plus() { - $font="Noto Sans Symbols2"; - legend("\u2B9D",[0,-0.7],size=5) - children(); -} - -module minus_text(text) { - legend(text,[0,-0.7],size=3.4) - children(); -} -module minus() { - $font="Noto Sans Symbols2"; - legend("\u2B9F",[0,0.7],size=5) - children(); -} - -module unicode(text) { - $font="Noto Sans Symbols2"; - legend(text,size=8) - children(); -} - -module front(text) { - front_legend(text,[0,-0.5],size=3) - children(); -} - -// RENDER stl -module foo() { - // This will silence my auto rendering script - echo(0); -} - -module numpad_iracing() { - layout_children(numpad_default_layout) { - intersection() { - front("SUB")plus_text("CAM") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("DRV")plus_text("CAR") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("FOV")plus_text("LAP") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("STEP")plus_text("INC") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - - intersection() { - front("SUB")minus_text("CAM") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("DRV")minus_text("CAR") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("FOV")minus_text("LAP") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("STEP")minus_text("INC") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - - unicode("\u23EA") dcs_row(1) key(); - unicode("\u25B6") bump() dcs_row(1) key(); - unicode("\u23E9") dcs_row(1) key(); - legend("SLOW", [0,-0.5], size=2.5) legend("MO", [0,0.5], size=2.5) dcs_row(1) key(); - - - unicode("\u23EE") dcs_row(2) key(); - unicode(chr(129153)) dcs_row(2) key(); // https://unicode-table.com/en/1F881/ - unicode("\u23ED") dcs_row(2) key(); - legend("ME",size=5) dcs_row(2) key(); - - unicode(chr(129152)) dcs_row(3) key(); // https://unicode-table.com/en/1F880/ - unicode(chr(129155)) dcs_row(3) key(); // https://unicode-table.com/en/1F883/ - unicode(chr(129154)) dcs_row(3) key(); // https://unicode-table.com/en/1F882/ - legend("CAM", [0,-0.5], size=3) legend("TOOL", [0,0.5], size=2.5) dcs_row(3) key(); - - front_legend("CTRL") dcs_row(4) key(); - front_legend("ALT") dcs_row(4) key(); - legend("PRINT", [0,-0.5], size=2.5) legend("SCREEN", [0,0.5], size=2) dcs_row(4) key(); - front_legend("MOD") - legend("UI",size=6) dcs_row(4) key(); - - }; -}; diff --git a/src/layouts/numpad/iracing.scad b/src/layouts/numpad/iracing.scad new file mode 100644 index 0000000..395e077 --- /dev/null +++ b/src/layouts/numpad/iracing.scad @@ -0,0 +1,123 @@ +// the point of this file is to be a sort of DSL for constructing keycaps. +// when you create a method chain you are just changing the parameters +// key.scad uses, it doesn't generate anything itself until the end. This +// lets it remain easy to use key.scad like before (except without key profiles) +// without having to rely on this file. Unfortunately that means setting tons of +// special variables, but that's a limitation of SCAD we have to work around + +include <./includes.scad> + +numpad_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] +]; + +$font_size=4; +$font="Noto Sans:style=bold"; + +module three_letters(text) { + legend(text,size=3) + children(); +} + +module plus_text(text) { + legend(text,[0,0.7],size=3.4) + children(); +} +module plus() { + $font="Noto Sans Symbols2"; + legend("\u2B9D",[0,-0.7],size=5) + children(); +} + +module minus_text(text) { + legend(text,[0,-0.7],size=3.4) + children(); +} +module minus() { + $font="Noto Sans Symbols2"; + legend("\u2B9F",[0,0.7],size=5) + children(); +} + +module unicode(text) { + $font="Noto Sans Symbols2"; + legend(text,size=8) + children(); +} + +module front(text) { + front_legend(text,[0,-0.5],size=3) + children(); +} + +// RENDER stl +module foo() { + // This will silence my auto rendering script + echo(0); +} + +module numpad_iracing() { + layout_children(numpad_default_layout) { + intersection() { + front("SUB")plus_text("CAM") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("DRV")plus_text("CAR") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("FOV")plus_text("LAP") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + intersection() { + front("STEP")plus_text("INC") dcs_row(0) key(); + plus()dcs_row(0) key(); + } + + intersection() { + front("SUB")minus_text("CAM") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("DRV")minus_text("CAR") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("FOV")minus_text("LAP") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + intersection() { + front("STEP")minus_text("INC") dcs_row(0) key(); + minus()dcs_row(0) key(); + } + + unicode("\u23EA") dcs_row(1) key(); + unicode("\u25B6") bump() dcs_row(1) key(); + unicode("\u23E9") dcs_row(1) key(); + legend("SLOW", [0,-0.5], size=2.5) legend("MO", [0,0.5], size=2.5) dcs_row(1) key(); + + + unicode("\u23EE") dcs_row(2) key(); + unicode(chr(129153)) dcs_row(2) key(); // https://unicode-table.com/en/1F881/ + unicode("\u23ED") dcs_row(2) key(); + legend("ME",size=5) dcs_row(2) key(); + + unicode(chr(129152)) dcs_row(3) key(); // https://unicode-table.com/en/1F880/ + unicode(chr(129155)) dcs_row(3) key(); // https://unicode-table.com/en/1F883/ + unicode(chr(129154)) dcs_row(3) key(); // https://unicode-table.com/en/1F882/ + legend("CAM", [0,-0.5], size=3) legend("TOOL", [0,0.5], size=2.5) dcs_row(3) key(); + + front_legend("CTRL") dcs_row(4) key(); + front_legend("ALT") dcs_row(4) key(); + legend("PRINT", [0,-0.5], size=2.5) legend("SCREEN", [0,0.5], size=2) dcs_row(4) key(); + front_legend("MOD") + legend("UI",size=6) dcs_row(4) key(); + + }; +}; From 6221733d1a9dfa00e3ad53f6b1aa8a3b63099d23 Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 12:41:16 -0500 Subject: [PATCH 08/13] cleanup --- keys.scad | 4 +- src/layouts/numpad/default.scad | 103 +++++++++++++++-------- src/layouts/numpad/iracing.scad | 139 +++++++++++++------------------- 3 files changed, 129 insertions(+), 117 deletions(-) diff --git a/keys.scad b/keys.scad index 44a390d..643306b 100644 --- a/keys.scad +++ b/keys.scad @@ -7,5 +7,7 @@ include <./includes.scad> -numpad_iracing(); +//numpad_iracing(); + +numpad_default(); diff --git a/src/layouts/numpad/default.scad b/src/layouts/numpad/default.scad index da22c88..0ca3835 100644 --- a/src/layouts/numpad/default.scad +++ b/src/layouts/numpad/default.scad @@ -1,52 +1,89 @@ include <../layout.scad> -// incomplete - -// how to make tall enter key? -// how to auto scale text? - +numpad_default_top_layout = [ + [1,1,1,1], +]; numpad_default_layout = [ [1,1,1,1], [1,1,1,1], [1,1,1,1], - [1,1,1,-1], - [2,1,-1] + [1,1,1], + [2,1,1] ]; -numpad_top_row_layout =[ - [1,1,1,1], -]; +module numpad_default() { + char_size=8; + unicode_font="Noto Sans Symbols2"; + front_offset=-0.2; -numpad_top_row_legends = [ - ["", "", "", "",], -]; + module profile(row) { + dcs_row(row) + children(); + } -numpad_default_legends = [ - ["num", "/", "*", "bksp", ], - ["7", "8", "9", "-",], - ["4", "5", "6", "+",], - ["1", "2", "3", ], - ["0", ".",], -]; + module char(text, pos=[0,0], size=char_size) { + legend(text,pos,size) + children(); + } -numpad_default_front_legends = [ - ["", "", "", "", ], - ["home", "\u2191", "pg up", "",], - ["\u2190", "", "\u2192", "",], - ["end", "\u2193", "pg down"], - ["ins", "del",], -]; + module unicode(text, pos=[0,0], size=char_size) { + $font=unicode_font; + legend(text,pos,size) + children(); + } + + module front_unicode(text,pos=[0,front_offset],size=5) { + $font=unicode_font; + front_legend(text,pos,size) + children(); + } + + module arrow(top, front, front_pos=[0,front_offset]) { + intersection() { + char(top)children(); + front_unicode(front, front_pos)children(); + } + } + + module front(text, pos=[0,front_offset], size=3) { + front_legend(text, pos, size) + children(); + } + + // estimated gap for kbdpad + translate_u(0,1.5) + layout_children(numpad_default_top_layout) { + profile(0) key(); + profile(0) key(); + profile(0) key(); + profile(0) key(); + }; + + layout_children(numpad_default_layout) { + legend("NUM", [0,-0.5], size=2.5) legend("LOCK", [0,0.5], size=2.5) profile(0) key(); + char("/") profile(0) key(); + char("*", [0,0.3]) profile(0) key(); + unicode(chr(129044),[0,0.2]) profile(0) key(); + front("HOME")char("7") profile(1) key(); + arrow("8", chr(129153)) profile(1) key(); + front("PG UP")char("9") profile(1) key(); + char("-", [0,0.3]) profile(1) key(); -module numpad_default(profile) { + arrow("4", chr(129152)) profile(2) key(); + char("5") profile(2) bump() key(); + arrow("6", chr(129154)) profile(2) key(); + char("+", [0,0.3]) profile(2) key(); - layout(numpad_default_layout, profile, numpad_default_legends, numpad_default_front_legends) children(); + front("END")char("1") profile(3) key(); + arrow("2", chr(129155),[0,0]) profile(3) key(); + front("PG DN")char("3") profile(3) key(); - translate_u(0,1.25) // this is not accurate - layout(numpad_top_row_layout, profile, numpad_top_row_legends) children(); + front("INS",[-1.07,front_offset])char("0") profile(4) 2u() key(); + front("DEL")char(".") profile(4) key(); + translate_u(0,0.5) unicode(chr(9166)) profile(2) 2uh() key(); - translate_u(3,-3.5) - layout([[1,],], profile, [["\u2386",]], row_override=3) numpad_enter() children(); + } } diff --git a/src/layouts/numpad/iracing.scad b/src/layouts/numpad/iracing.scad index 395e077..1fac621 100644 --- a/src/layouts/numpad/iracing.scad +++ b/src/layouts/numpad/iracing.scad @@ -1,13 +1,8 @@ -// the point of this file is to be a sort of DSL for constructing keycaps. -// when you create a method chain you are just changing the parameters -// key.scad uses, it doesn't generate anything itself until the end. This -// lets it remain easy to use key.scad like before (except without key profiles) -// without having to rely on this file. Unfortunately that means setting tons of -// special variables, but that's a limitation of SCAD we have to work around - -include <./includes.scad> +numpad_iracing_top_layout = [ + [1,1,1,1], +]; -numpad_default_layout = [ +numpad_iracing_layout = [ [1,1,1,1], [1,1,1,1], [1,1,1,1], @@ -16,86 +11,64 @@ numpad_default_layout = [ [1,1,1,1] ]; -$font_size=4; -$font="Noto Sans:style=bold"; - -module three_letters(text) { - legend(text,size=3) - children(); -} - -module plus_text(text) { - legend(text,[0,0.7],size=3.4) - children(); -} -module plus() { - $font="Noto Sans Symbols2"; - legend("\u2B9D",[0,-0.7],size=5) - children(); -} - -module minus_text(text) { - legend(text,[0,-0.7],size=3.4) - children(); -} -module minus() { - $font="Noto Sans Symbols2"; - legend("\u2B9F",[0,0.7],size=5) - children(); -} - -module unicode(text) { - $font="Noto Sans Symbols2"; - legend(text,size=8) - children(); -} - -module front(text) { - front_legend(text,[0,-0.5],size=3) - children(); -} - -// RENDER stl -module foo() { - // This will silence my auto rendering script - echo(0); -} - module numpad_iracing() { - layout_children(numpad_default_layout) { - intersection() { - front("SUB")plus_text("CAM") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("DRV")plus_text("CAR") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("FOV")plus_text("LAP") dcs_row(0) key(); - plus()dcs_row(0) key(); - } - intersection() { - front("STEP")plus_text("INC") dcs_row(0) key(); - plus()dcs_row(0) key(); - } + $font_size=4; + $font="Noto Sans:style=bold"; + module three_letters(text) { + legend(text,size=3) + children(); + } + + module plus(top, front) { intersection() { - front("SUB")minus_text("CAM") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("DRV")minus_text("CAR") dcs_row(0) key(); - minus()dcs_row(0) key(); - } - intersection() { - front("FOV")minus_text("LAP") dcs_row(0) key(); - minus()dcs_row(0) key(); + legend(top,[0,0.7],size=3.4) front(front) children(); + plus_symbol() children(); } + } + module plus_symbol() { + $font="Noto Sans Symbols2"; + legend("\u2B9D",[0,-0.7],size=5) + children(); + } + + module minus(top,front) { intersection() { - front("STEP")minus_text("INC") dcs_row(0) key(); - minus()dcs_row(0) key(); + legend(top,[0,-0.7],size=3.4) front(front) children(); + minus_symbol() children(); } + } + module minus_symbol() { + $font="Noto Sans Symbols2"; + legend("\u2B9F",[0,0.7],size=5) + children(); + } + + module unicode(text) { + $font="Noto Sans Symbols2"; + legend(text,size=8) + children(); + } + + module front(text) { + front_legend(text,[0,-0.5],size=3) + children(); + } + + // estimated gap for top row of kbdpad + translate_u(0,1.25) + layout_children(numpad_iracing_top_layout) { + plus("CAM", "SUB") dcs_row(0) key(); + plus("CAR", "DRV") dcs_row(0) key(); + plus("LAP", "FOV") dcs_row(0) key(); + plus("INC", "STEP") dcs_row(0) key(); + } + + layout_children(numpad_iracing_layout) { + minus("CAM", "SUB") dcs_row(0) key(); + minus("CAR", "DRV") dcs_row(0) key(); + minus("LAP", "FOV") dcs_row(0) key(); + minus("INC", "STEP") dcs_row(0) key(); unicode("\u23EA") dcs_row(1) key(); unicode("\u25B6") bump() dcs_row(1) key(); From 2ac3ad39f3b5cd9e6b1957683425aeba0c472aca Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 12:50:33 -0500 Subject: [PATCH 09/13] cleanup layouts --- src/layouts/layout.scad | 43 ++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/src/layouts/layout.scad b/src/layouts/layout.scad index 7019a6d..630bd30 100644 --- a/src/layouts/layout.scad +++ b/src/layouts/layout.scad @@ -5,23 +5,6 @@ function abs_sum(list, x=0) = x + abs(list[0]) : abs_sum([for (x = [1: len(list) - 1]) list[x]], x+abs(list[0])); -function row(list, n, count=0, row=0, col=0) = - count == n ? - row : - col >= len(list[row]) - 1 ? - row(list, n, count+1, row+1, 0) : - row(list, n, count+1, row, col+1); - -function col(list, n, count=0, row=0, col=0) = - count == n ? - col : - col >= len(list[row]) - 1 ? - col(list, n, count+1, row+1, 0) : - col(list, n, count+1, row, col+1); - - - - function 2hands(index, total) = ((index+0.5) % (total/2)) - (total/4); function cresting_wave(index, total, mod=4) = (index < total/2) ? (((index + 0.5) / total)*mod) : -(mod - ((index + 0.5) / total * mod)); @@ -38,7 +21,7 @@ function double_sculpted_column(column, row_length, column_sculpt_profile) = 1hand(column, row_length) : (column_sculpt_profile == "cresting_wave") ? cresting_wave(column, row_length) : 0; -module layout(list, profile="dcs", legends=undef, front_legends=undef, children_overrides=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) { +module layout(list, profile="dcs", legends=undef, front_legends=undef, row_sculpting_offset=0, row_override=undef, column_sculpt_profile="2hands", column_override=undef) { for (row = [0:len(list)-1]){ /* echo("**ROW**:", row); */ row_length = len(list[row]); @@ -146,17 +129,29 @@ module simple_layout(list) { } } -//function count_position(row,column) - +// layout function for use with advanced legends (multiple fonts and font sizes) +// see numpad layouts for an example module layout_children(list, items) { for (n=[0:1:$children-1]){ - row = row(list,n); - column = col(list,n); - echo(row=row); - echo(column=column); + row = layout_children_row(list,n); + column = layout_children_col(list,n); key_length = list[row][column]; column_distance = abs_sum([for (x = [0 : column]) list[row][x]]); translate_u(column_distance - (key_length/2), -row) children(n); } } + +function layout_children_row(list, n, count=0, row=0, col=0) = + count == n ? + row : + col >= len(list[row]) - 1 ? + layout_children_row(list, n, count+1, row+1, 0) : + layout_children_row(list, n, count+1, row, col+1); + +function layout_children_col(list, n, count=0, row=0, col=0) = + count == n ? + col : + col >= len(list[row]) - 1 ? + layout_children_col(list, n, count+1, row+1, 0) : + layout_children_col(list, n, count+1, row, col+1); From e60218b8edcf565eadedd6a569fd7ffc85b1dc4c Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 12:55:05 -0500 Subject: [PATCH 10/13] clean up cruft from other pull requests --- includes.scad | 1 - keys.scad | 11 +++++++++-- src/alignment_tool.scad | 15 --------------- src/key_layouts.scad | 2 -- 4 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 src/alignment_tool.scad diff --git a/includes.scad b/includes.scad index fe0ae05..abb077f 100644 --- a/includes.scad +++ b/includes.scad @@ -7,4 +7,3 @@ include include include include -include diff --git a/keys.scad b/keys.scad index 643306b..768110e 100644 --- a/keys.scad +++ b/keys.scad @@ -7,7 +7,14 @@ include <./includes.scad> -//numpad_iracing(); -numpad_default(); +// example key +dcs_row(5) legend("⇪", size=9) key(); +// example row +/* for (x = [0:1:4]) { + translate_u(0,-x) dcs_row(x) key(); +} */ + +// example layout +/* preonic_default("dcs"); */ \ No newline at end of file diff --git a/src/alignment_tool.scad b/src/alignment_tool.scad deleted file mode 100644 index 4507e9e..0000000 --- a/src/alignment_tool.scad +++ /dev/null @@ -1,15 +0,0 @@ -include <./includes.scad> - -// Tool for keeping switches aligned while soldering -// Keep the bar high enough that when the keyboard is upside down the switches can be fully depressed - -module alignment_tool(layout=[[1,1,1,1,1]], bar_height=$stem_throw*1.2) { - bar_width=unit/2; - simple_layout(layout) - stem($stem_type, $stem_throw, $stem_slop, $stem_throw); - hull() { - simple_layout(layout) - translate([-unit/2,-bar_width/2,$stem_throw]) - cube([unit,bar_width,bar_height]); - } -} diff --git a/src/key_layouts.scad b/src/key_layouts.scad index 6249717..7b53a51 100644 --- a/src/key_layouts.scad +++ b/src/key_layouts.scad @@ -20,6 +20,4 @@ include include include - - include From a02b62ce9f47f4353bed4949e6f455f63f1fa64e Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Tue, 16 Mar 2021 12:57:31 -0500 Subject: [PATCH 11/13] tidy up whitespace --- src/layouts/layout.scad | 1 - 1 file changed, 1 deletion(-) diff --git a/src/layouts/layout.scad b/src/layouts/layout.scad index 630bd30..3dbd3a9 100644 --- a/src/layouts/layout.scad +++ b/src/layouts/layout.scad @@ -5,7 +5,6 @@ function abs_sum(list, x=0) = x + abs(list[0]) : abs_sum([for (x = [1: len(list) - 1]) list[x]], x+abs(list[0])); - function 2hands(index, total) = ((index+0.5) % (total/2)) - (total/4); function cresting_wave(index, total, mod=4) = (index < total/2) ? (((index + 0.5) / total)*mod) : -(mod - ((index + 0.5) / total * mod)); function 1hand(index, total) = (index % (total)) - (total/2); From 37f23abd23b45004321f5f7943fe67cbe0b8eada Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Sat, 20 Mar 2021 10:13:44 -0500 Subject: [PATCH 12/13] updates to layouts, messing with color --- src/layouts/numpad/default.scad | 84 +++++++++++++++------- src/layouts/numpad/iracing.scad | 123 +++++++++++++++++++++++--------- 2 files changed, 149 insertions(+), 58 deletions(-) diff --git a/src/layouts/numpad/default.scad b/src/layouts/numpad/default.scad index 0ca3835..6d4a065 100644 --- a/src/layouts/numpad/default.scad +++ b/src/layouts/numpad/default.scad @@ -6,7 +6,7 @@ numpad_default_top_layout = [ numpad_default_layout = [ [1,1,1,1], - [1,1,1,1], + [1,1,1], [1,1,1,1], [1,1,1], [2,1,1] @@ -16,6 +16,7 @@ module numpad_default() { char_size=8; unicode_font="Noto Sans Symbols2"; front_offset=-0.2; + $font="Noto Sans:style=bold"; module profile(row) { dcs_row(row) @@ -51,39 +52,74 @@ module numpad_default() { children(); } - // estimated gap for kbdpad + module front_char(text, pos=[0,front_offset], size=5) { + front_legend(text, pos, size) + children(); + } + + colors=true; + module ifcolor(c) { + if(colors) { + color(c) + children(); + } else { + children(); + } + } + module num() { + ifcolor("purple") + children(); + } + + module sym() { + ifcolor("gray") + children(); + } + module ctl() { + ifcolor("sienna") + children(); + } + module arw() { + ifcolor("red") + children(); + } + + // kbdpad has an extra top row translate_u(0,1.5) layout_children(numpad_default_top_layout) { - profile(0) key(); - profile(0) key(); - profile(0) key(); - profile(0) key(); + legend("ESC", size=4) profile(0) ctl() key(); + front_char("%") legend("TAB", size=4) profile(0) ctl() key(); + front_char(")") legend("DEL", size=4) profile(0) ctl() key(); + intersection() { + front_char(")") profile(0) ctl() key(); + unicode(chr(129044),[0,0.2]) profile(0) ctl() key(); + } }; layout_children(numpad_default_layout) { - legend("NUM", [0,-0.5], size=2.5) legend("LOCK", [0,0.5], size=2.5) profile(0) key(); - char("/") profile(0) key(); - char("*", [0,0.3]) profile(0) key(); - unicode(chr(129044),[0,0.2]) profile(0) key(); + front("MOD") legend("NUM", [0,-0.5], size=2.5) legend("LOCK", [0,0.5], size=2.5) profile(0) ctl() key(); + //unicode("⇭") profile(0) key(); + front_char("$") char("/") profile(0) sym() key(); + front_char("=") char("*", [0,0.3]) profile(0) sym() key(); + front_char(",") char("-", [0,0.3]) profile(0) sym() key(); - front("HOME")char("7") profile(1) key(); - arrow("8", chr(129153)) profile(1) key(); - front("PG UP")char("9") profile(1) key(); - char("-", [0,0.3]) profile(1) key(); + front("HOME")char("7") profile(1) num() key(); + arrow("8", chr(129153)) profile(1) arw() key(); + front("PG UP")char("9") profile(1) num() key(); - arrow("4", chr(129152)) profile(2) key(); - char("5") profile(2) bump() key(); - arrow("6", chr(129154)) profile(2) key(); - char("+", [0,0.3]) profile(2) key(); + arrow("4", chr(129152)) profile(2) arw() key(); + arrow("5", chr(129155),[0,0]) bump() profile(2) arw() key(); + arrow("6", chr(129154)) profile(2) arw() key(); + translate_u(0,0.5) char("+") profile(1) 2uh() sym() key(); - front("END")char("1") profile(3) key(); - arrow("2", chr(129155),[0,0]) profile(3) key(); - front("PG DN")char("3") profile(3) key(); + front("END")char("1") profile(3) num() key(); + arrow("2", chr(129155),[0,0]) profile(3) num() key(); + front("PG DN")char("3") profile(3) num() key(); - front("INS",[-1.07,front_offset])char("0") profile(4) 2u() key(); - front("DEL")char(".") profile(4) key(); - translate_u(0,0.5) unicode(chr(9166)) profile(2) 2uh() key(); + front("INS",[-1.07,front_offset])char("0") profile(4) 2u() num() key(); + front("DEL")char(".") profile(4) sym() key(); + translate_u(0,0.5) unicode(chr(9166)) profile(2) 2uh() sym() key(); } } diff --git a/src/layouts/numpad/iracing.scad b/src/layouts/numpad/iracing.scad index 1fac621..fb024e3 100644 --- a/src/layouts/numpad/iracing.scad +++ b/src/layouts/numpad/iracing.scad @@ -15,11 +15,6 @@ module numpad_iracing() { $font_size=4; $font="Noto Sans:style=bold"; - module three_letters(text) { - legend(text,size=3) - children(); - } - module plus(top, front) { intersection() { legend(top,[0,0.7],size=3.4) front(front) children(); @@ -44,9 +39,9 @@ module numpad_iracing() { children(); } - module unicode(text) { + module unicode(text,size=8) { $font="Noto Sans Symbols2"; - legend(text,size=8) + legend(text,size=size) children(); } @@ -55,42 +50,102 @@ module numpad_iracing() { children(); } + cam_color="sienna"; + car_color="gray"; + lap_color="sienna"; + inc_color="gray"; + // estimated gap for top row of kbdpad translate_u(0,1.25) layout_children(numpad_iracing_top_layout) { - plus("CAM", "SUB") dcs_row(0) key(); - plus("CAR", "DRV") dcs_row(0) key(); - plus("LAP", "FOV") dcs_row(0) key(); - plus("INC", "STEP") dcs_row(0) key(); + plus("CAM", "SUB") dcs_row(0) if_color(cam_color) key(); + plus("CAR", "DRV") dcs_row(0) if_color(car_color) key(); + plus("LAP", "SES") dcs_row(0) if_color(lap_color) key(); + plus("INC", "START") dcs_row(0) if_color(inc_color)key(); } + colors=false; + + module if_color(c) { + if(colors){ + color(c) + children(); + } else { + children(); + } + + } + + module frame() { + if_color("gold") children(); + } + + module direction() { + if_color("darkorange") children(); + } + + module red() { + if_color("red") children(); + } + + module silver() { + if_color("gray") children(); + } + + module brown() { + if_color("sienna") children(); + } + + module mods() { + if_color("gray") children(); + } + + module purple() { + if_color("purple") children(); + //$primary_color="purple"; + //$secondary_color="purple"; + //children(); + } + + + layout_children(numpad_iracing_layout) { - minus("CAM", "SUB") dcs_row(0) key(); - minus("CAR", "DRV") dcs_row(0) key(); - minus("LAP", "FOV") dcs_row(0) key(); - minus("INC", "STEP") dcs_row(0) key(); + minus("CAM", "SUB") dcs_row(0) if_color(cam_color) key(); + minus("CAR", "DRV") dcs_row(0) if_color(car_color)key(); + minus("LAP", "SES") dcs_row(0) if_color(lap_color) key(); + minus("INC", "END") dcs_row(0) if_color(inc_color) key(); - unicode("\u23EA") dcs_row(1) key(); - unicode("\u25B6") bump() dcs_row(1) key(); - unicode("\u23E9") dcs_row(1) key(); - legend("SLOW", [0,-0.5], size=2.5) legend("MO", [0,0.5], size=2.5) dcs_row(1) key(); + unicode("\u23EA") dcs_row(1) direction() key(); + unicode("\u25B6") bump() dcs_row(1) red() key(); + unicode("\u23E9") dcs_row(1) direction() key(); + unicode(chr(9201),6) dcs_row(1) purple() key(); - unicode("\u23EE") dcs_row(2) key(); - unicode(chr(129153)) dcs_row(2) key(); // https://unicode-table.com/en/1F881/ - unicode("\u23ED") dcs_row(2) key(); - legend("ME",size=5) dcs_row(2) key(); - - unicode(chr(129152)) dcs_row(3) key(); // https://unicode-table.com/en/1F880/ - unicode(chr(129155)) dcs_row(3) key(); // https://unicode-table.com/en/1F883/ - unicode(chr(129154)) dcs_row(3) key(); // https://unicode-table.com/en/1F882/ - legend("CAM", [0,-0.5], size=3) legend("TOOL", [0,0.5], size=2.5) dcs_row(3) key(); - - front_legend("CTRL") dcs_row(4) key(); - front_legend("ALT") dcs_row(4) key(); - legend("PRINT", [0,-0.5], size=2.5) legend("SCREEN", [0,0.5], size=2) dcs_row(4) key(); - front_legend("MOD") - legend("UI",size=6) dcs_row(4) key(); + unicode("\u23EE") dcs_row(2) frame() key(); + unicode(chr(129153)) dcs_row(2) purple() key(); // https://unicode-table.com/en/1F881/ + unicode("\u23ED") dcs_row(2) frame() key(); + unicode(chr(9210)) dcs_row(2) frame() key(); + //legend("PRINT", [0,-0.6], size=2.5) legend("SCREEN", [0,0.6], size=2) dcs_row(2) brown() key(); + + unicode(chr(129152)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F880/ + unicode(chr(129155)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F883/ + unicode(chr(129154)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F882/ + unicode(chr(128253)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F882/ + //legend("CAM", [0,-0.6], size=3.5) legend("TOOL", [0,0.7], size=2.9) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F881/ + + front_legend("CTRL") dcs_row(4) mods() key(); + front_legend("ALT") dcs_row(4) mods() key(); + //unicode(chr(11017)) unicode(chr(11018)) dcs_row(4) purple() key(); // https://unicode-table.com/en/1F881/ + fullscreen_size=11; + intersection() { + unicode("\u2B66",fullscreen_size) + unicode("\u2B68",fullscreen_size) + unicode("\u2B67",fullscreen_size) + unicode("\u2B69",fullscreen_size) + dcs_row(4) purple() key(); + front_legend("AIM") dcs_row(4) purple() key(); + } + front_legend("MOD") legend("UI",size=6) dcs_row(4) mods() key(); }; }; From c48d741c600e8be7495357418792601cc41186da Mon Sep 17 00:00:00 2001 From: Aaron VerDow Date: Sun, 21 Mar 2021 17:19:26 -0500 Subject: [PATCH 13/13] dirty iracing update --- src/layouts/numpad/iracing.scad | 46 +++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/layouts/numpad/iracing.scad b/src/layouts/numpad/iracing.scad index fb024e3..73fd28b 100644 --- a/src/layouts/numpad/iracing.scad +++ b/src/layouts/numpad/iracing.scad @@ -39,17 +39,33 @@ module numpad_iracing() { children(); } + module front_unicode(text,size=8) { + $font="Noto Sans Symbols2"; + front_legend(text,size=size) + children(); + } module unicode(text,size=8) { $font="Noto Sans Symbols2"; legend(text,size=size) children(); } + module unicode_and_front(code,text) { + intersection() { + unicode(code) + children(); + front(text) + children(); + } + } + + module front(text) { front_legend(text,[0,-0.5],size=3) children(); } + cam_color="sienna"; car_color="gray"; lap_color="sienna"; @@ -115,14 +131,14 @@ module numpad_iracing() { minus("LAP", "SES") dcs_row(0) if_color(lap_color) key(); minus("INC", "END") dcs_row(0) if_color(inc_color) key(); - unicode("\u23EA") dcs_row(1) direction() key(); - unicode("\u25B6") bump() dcs_row(1) red() key(); + unicode_and_front("\u23EA","FOV") dcs_row(1) direction() key(); + unicode_and_front("\u25B6","STEP") bump() dcs_row(1) red() key(); unicode("\u23E9") dcs_row(1) direction() key(); unicode(chr(9201),6) dcs_row(1) purple() key(); - unicode("\u23EE") dcs_row(2) frame() key(); - unicode(chr(129153)) dcs_row(2) purple() key(); // https://unicode-table.com/en/1F881/ + unicode_and_front("\u23EE","FOV") dcs_row(2) frame() key(); + unicode_and_front(chr(129153),"STEP") dcs_row(2) purple() key(); // https://unicode-table.com/en/1F881/ unicode("\u23ED") dcs_row(2) frame() key(); unicode(chr(9210)) dcs_row(2) frame() key(); //legend("PRINT", [0,-0.6], size=2.5) legend("SCREEN", [0,0.6], size=2) dcs_row(2) brown() key(); @@ -130,21 +146,19 @@ module numpad_iracing() { unicode(chr(129152)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F880/ unicode(chr(129155)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F883/ unicode(chr(129154)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F882/ - unicode(chr(128253)) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F882/ + dcs_row(3) purple() key(); // https://unicode-table.com/en/1F882/ //legend("CAM", [0,-0.6], size=3.5) legend("TOOL", [0,0.7], size=2.9) dcs_row(3) purple() key(); // https://unicode-table.com/en/1F881/ - front_legend("CTRL") dcs_row(4) mods() key(); - front_legend("ALT") dcs_row(4) mods() key(); + legend("CTRL",size=3) dcs_row(4) mods() key(); + legend("ALT") front_legend("AIM") dcs_row(4) mods() key(); //unicode(chr(11017)) unicode(chr(11018)) dcs_row(4) purple() key(); // https://unicode-table.com/en/1F881/ - fullscreen_size=11; - intersection() { - unicode("\u2B66",fullscreen_size) - unicode("\u2B68",fullscreen_size) - unicode("\u2B67",fullscreen_size) - unicode("\u2B69",fullscreen_size) - dcs_row(4) purple() key(); - front_legend("AIM") dcs_row(4) purple() key(); - } + fullscreen_size=7.5; + unicode(chr(128253)) + front_unicode("\u2B66",fullscreen_size) + front_unicode("\u2B68",fullscreen_size) + front_unicode("\u2B67",fullscreen_size) + front_unicode("\u2B69",fullscreen_size) + dcs_row(4) purple() key(); front_legend("MOD") legend("UI",size=6) dcs_row(4) mods() key(); };