From 8c5e8603cf21caf35560b4bdfb16b9ed18116548 Mon Sep 17 00:00:00 2001 From: Kuba Tyszko Date: Tue, 25 Aug 2020 12:53:24 -0700 Subject: [PATCH 1/5] first draft of commodore64 compatible keys - mostly stem modifications compared to cherry --- src/functions.scad | 10 ++++++++++ src/key_transformations.scad | 6 ++++++ src/settings.scad | 1 + src/stems.scad | 3 +++ src/stems/c64.scad | 37 ++++++++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 src/stems/c64.scad diff --git a/src/functions.scad b/src/functions.scad index 13cad08..d225cc6 100644 --- a/src/functions.scad +++ b/src/functions.scad @@ -7,6 +7,8 @@ include // cherry stem dimensions function outer_cherry_stem(slop) = [7.2 - slop * 2, 5.5 - slop * 2]; +function outer_c64_stem(slop) = [7.2 - slop * 2, 7.2 - slop * 2]; + // cherry stabilizer stem dimensions function outer_cherry_stabilizer_stem(slop) = [4.85 - slop * 2, 6.05 - slop * 2]; @@ -21,6 +23,14 @@ function cherry_cross(slop, extra_vertical = 0) = [ [1.15 + slop / 3, 4.23 + extra_vertical + slop / 3 + SMALLEST_POSSIBLE], ]; +function c64_cross(slop, extra_vertical = 0) = [ + // horizontal tine + [5.5 + slop, 1.7 + slop / 3], + // vertical tine + [1.7 + slop / 3, 5.23 + extra_vertical + slop / 3 + SMALLEST_POSSIBLE], +]; + + // actual mm key width and height function total_key_width(delta = 0) = $bottom_key_width + $unit * ($key_length - 1) - delta; function total_key_height(delta = 0) = $bottom_key_height + $unit * ($key_height - 1) - delta; diff --git a/src/key_transformations.scad b/src/key_transformations.scad index c47289c..1e5454b 100644 --- a/src/key_transformations.scad +++ b/src/key_transformations.scad @@ -92,6 +92,12 @@ module blank() { children(); } +module c64(slop) { + $stem_slop = slop ? slop : $stem_slop; + $stem_type = "c64"; + children(); +} + module cherry(slop) { $stem_slop = slop ? slop : $stem_slop; $stem_type = "cherry"; diff --git a/src/settings.scad b/src/settings.scad index fe22654..89430c3 100644 --- a/src/settings.scad +++ b/src/settings.scad @@ -114,6 +114,7 @@ $dish_overdraw_height = 0; /* [Misc] */ // There's a bevel on the cherry stems to aid insertion / guard against first layer squishing making a hard-to-fit stem. $cherry_bevel = true; +$c64_bevel = true; // How tall in mm the stem support is, if there is any. stem support sits around the keystem and helps to secure it while printing. $stem_support_height = .8; diff --git a/src/stems.scad b/src/stems.scad index 6a8cfbe..326c6c5 100644 --- a/src/stems.scad +++ b/src/stems.scad @@ -1,4 +1,5 @@ include +include include include include @@ -13,6 +14,8 @@ module stem(stem_type, depth, slop, throw){ alps_stem(depth, slop, throw); } else if (stem_type == "cherry" || stem_type == "costar_stabilizer") { cherry_stem(depth, slop, throw); + } else if (stem_type == "c64" ) { + c64_stem(depth, slop, throw); } else if (stem_type == "rounded_cherry") { rounded_cherry_stem(depth, slop, throw); } else if (stem_type == "box_cherry") { diff --git a/src/stems/c64.scad b/src/stems/c64.scad new file mode 100644 index 0000000..052d3cc --- /dev/null +++ b/src/stems/c64.scad @@ -0,0 +1,37 @@ +include <../functions.scad> + +// extra length to the vertical tine of the inside c64 cross +// splits the stem into halves - allows easier fitment +extra_vertical = 0.6; + +module inside_c64_cross(slop) { + // inside cross + // translation purely for aesthetic purposes, to get rid of that awful lattice + translate([0,0,-SMALLEST_POSSIBLE]) { + linear_extrude(height = $stem_throw) { + square(c64_cross(slop, extra_vertical)[0], center=true); + square(c64_cross(slop, extra_vertical)[1], center=true); + } + } + + // Guides to assist insertion and mitigate first layer squishing + if ($c64_bevel){ + for (i = c64_cross(slop, extra_vertical)) hull() { + linear_extrude(height = 0.01, center = false) offset(delta = 0.1) square(i, center=true); + translate([0, 0, 0.1]) linear_extrude(height = 0.01, center = false) square(i, center=true); + } + } +} + +module c64_stem(depth, slop, throw) { + difference(){ + // outside shape + linear_extrude(height = depth) { + offset(r=1){ + square(outer_c64_stem(slop) - [2,2], center=true); + } + } + + inside_c64_cross($stem_inner_slop); + } +} From b097e7755c0a75d0f7a61f82fb4d153853cbf1de Mon Sep 17 00:00:00 2001 From: Kuba Tyszko Date: Mon, 14 Dec 2020 09:27:39 -0800 Subject: [PATCH 2/5] Keyset for Commodore 64 - based on SA profile, no PETSCII legends --- customizer.scad | 1 + examples/commodore_64_keyset.scat | 4 +++ keys.scad | 12 +++++++- src/functions.scad | 10 +++++-- src/key_layouts.scad | 2 ++ src/key_sizes.scad | 9 ++++++ src/key_types.scad | 6 ++++ src/settings.scad | 8 ++++-- src/stem_supports/brim.scad | 5 ++++ src/stem_supports/tines.scad | 47 +++++++++++++++++++++++-------- src/stems/c64.scad | 15 ++++++---- 11 files changed, 96 insertions(+), 23 deletions(-) create mode 100644 examples/commodore_64_keyset.scat diff --git a/customizer.scad b/customizer.scad index ad30bbb..d74c74a 100644 --- a/customizer.scad +++ b/customizer.scad @@ -86,6 +86,7 @@ $stem_throw = 4; // Diameter of the outside of the rounded cherry stem $rounded_cherry_stem_d = 5.5; +$c64_stem_d = 5; // How much higher the stem is than the bottom of the keycap. // Inset stem requires support but is more accurate in some profiles diff --git a/examples/commodore_64_keyset.scat b/examples/commodore_64_keyset.scat new file mode 100644 index 0000000..4b2a3cf --- /dev/null +++ b/examples/commodore_64_keyset.scat @@ -0,0 +1,4 @@ +include <./includes.scad> + +c64_default("sa") c64() key(); + diff --git a/keys.scad b/keys.scad index 768110e..f3d6166 100644 --- a/keys.scad +++ b/keys.scad @@ -9,7 +9,17 @@ include <./includes.scad> // example key -dcs_row(5) legend("⇪", size=9) key(); +dsa_row(1) legend("Q", size=9) c64() key(); + +translate([-1.5/2,-1.5/2,0]) +cube([1.5,1.5,1.5]); + + +translate([-5/2,-1.5/2,0]) +cube([5,1.5,1.5]); + +translate([-0.75,-5/2,0]) +cube([1.5,5,1.5]); // example row /* for (x = [0:1:4]) { diff --git a/src/functions.scad b/src/functions.scad index d225cc6..0648ba2 100644 --- a/src/functions.scad +++ b/src/functions.scad @@ -25,11 +25,17 @@ function cherry_cross(slop, extra_vertical = 0) = [ function c64_cross(slop, extra_vertical = 0) = [ // horizontal tine - [5.5 + slop, 1.7 + slop / 3], + [5.0 + slop, 1.5 + slop / 3], // vertical tine - [1.7 + slop / 3, 5.23 + extra_vertical + slop / 3 + SMALLEST_POSSIBLE], + [1.5 + slop / 3, 5.0 + extra_vertical + slop / 3 + SMALLEST_POSSIBLE], ]; +function c64_inner_cross(slop, extra_vertical = 0) = [ + // horizontal tine + [5.4 + slop, 1.7 + slop / 3], + // vertical tine + [1.7 + slop / 3, 5.4 + extra_vertical + slop / 3 + SMALLEST_POSSIBLE], +]; // actual mm key width and height function total_key_width(delta = 0) = $bottom_key_width + $unit * ($key_length - 1) - delta; diff --git a/src/key_layouts.scad b/src/key_layouts.scad index 10b5630..5026832 100644 --- a/src/key_layouts.scad +++ b/src/key_layouts.scad @@ -1,5 +1,7 @@ include +include + include include diff --git a/src/key_sizes.scad b/src/key_sizes.scad index 6e06fb5..8380062 100644 --- a/src/key_sizes.scad +++ b/src/key_sizes.scad @@ -33,6 +33,11 @@ module 6_25u() { u(6.25) children(); } +module 9u() { + u(9) children(); +} + + // key height functions module uh(u=1) { @@ -67,3 +72,7 @@ module 2_75uh() { module 6_25uh() { uh(6.25) children(); } + +module 9uh() { + uh(9) children(); +} diff --git a/src/key_types.scad b/src/key_types.scad index 73f8dc1..efa69d7 100644 --- a/src/key_types.scad +++ b/src/key_types.scad @@ -6,6 +6,12 @@ module spacebar() { 6_25u() stabilized(mm=50) children(); } +module c64_spacebar() { + $inverted_dish = true; + $dish_type = "sideways cylindrical"; + 9u() stabilized(mm=50) children(); +} + module lshift() { 2_25u() stabilized() children(); } diff --git a/src/settings.scad b/src/settings.scad index 89430c3..18562a1 100644 --- a/src/settings.scad +++ b/src/settings.scad @@ -4,7 +4,7 @@ $key_length = 1.0; // Range not working in thingiverse customizer atm [1:0.25:16] // What type of stem you want. Most people want Cherry. -$stem_type = "cherry"; // [cherry, alps, rounded_cherry, box_cherry, filled, disable] +$stem_type = "cherry"; // [cherry, alps, rounded_cherry, box_cherry, filled, c64, disable] // The stem is the hardest part to print, so this variable controls how much 'slop' there is in the stem // if your keycaps stick in the switch raise this value @@ -67,10 +67,11 @@ $top_skew_x = 0; /* [Stem] */ // How far the throw distance of the switch is. determines how far the 'cross' in the cherry switch digs into the stem, and how long the keystem needs to be before supports can start. luckily, alps and cherries have a pretty similar throw. can modify to have stouter keycaps for low profile switches, etc -$stem_throw = 4; +$stem_throw = 5; // Diameter of the outside of the rounded cherry stem $rounded_cherry_stem_d = 5.5; +$c64_stem_d = 9; // How much higher the stem is than the bottom of the keycap. // Inset stem requires support but is more accurate in some profiles @@ -119,7 +120,8 @@ $c64_bevel = true; // How tall in mm the stem support is, if there is any. stem support sits around the keystem and helps to secure it while printing. $stem_support_height = .8; // Font used for text -$font="DejaVu Sans Mono:style=Book"; +//$font="DejaVu Sans Mono:style=Book"; +$font="Trade Gothic Bold Condensed"; // Whether or not to render fake keyswitches to check clearances $clearance_check = false; // Should be faster, also required for concave shapes diff --git a/src/stem_supports/brim.scad b/src/stem_supports/brim.scad index 97ae5dc..4c0c542 100644 --- a/src/stem_supports/brim.scad +++ b/src/stem_supports/brim.scad @@ -23,6 +23,11 @@ module brim_support(stem_type, stem_support_height, slop) { cylinder(d=$rounded_cherry_stem_d * 2, h=stem_support_height); inside_cherry_cross(slop); } + } else if (stem_type == "c64") { + difference() { + cylinder(d=$c64_stem_d * 2, h=stem_support_height); + inside_c64_cross(slop); + } } else if (stem_type == "box_cherry") { difference() { linear_extrude(height = stem_support_height){ diff --git a/src/stem_supports/tines.scad b/src/stem_supports/tines.scad index 56ff739..5b22dc7 100644 --- a/src/stem_supports/tines.scad +++ b/src/stem_supports/tines.scad @@ -1,20 +1,35 @@ include <../functions.scad> include <../stems/cherry.scad> -module centered_tines(stem_support_height) { +module centered_tines(stem_type,stem_support_height) { if ($key_length < 2) { translate([0,0,$stem_support_height / 2]) { - cube([total_key_width(), 0.5, $stem_support_height], center = true); + if (stem_type == "c64"){ + cube([total_key_width()-0.5, 0.5, $stem_support_height], center = true); + } + else { + cube([total_key_width(), 0.5, $stem_support_height], center = true); + } } } translate([0,0,$stem_support_height / 2]) { - cube([ - 1, - total_key_height(), - $stem_support_height - ], - center = true); + if (stem_type == "c64"){ + cube([ + 1, + total_key_height()-0.5, + $stem_support_height + ], + center = true); + } + else{ + cube([ + 1, + total_key_height(), + $stem_support_height + ], + center = true); + } } } @@ -65,17 +80,25 @@ module tines_support(stem_type, stem_support_height, slop) { } } else if (stem_type == "box_cherry") { difference () { - centered_tines(stem_support_height); + centered_tines(stem_type, stem_support_height); inside_cherry_cross(slop); } } else if (stem_type == "rounded_cherry") { difference () { - centered_tines(stem_support_height); + centered_tines(stem_type, stem_support_height); inside_cherry_cross(slop); } - } else if (stem_type == "alps"){ - centered_tines(stem_support_height); + + } else if (stem_type == "c64") { + difference () { + centered_tines(stem_type, stem_support_height); + + inside_c64_cross(slop); + } + } + else if (stem_type == "alps"){ + centered_tines(stem_type,stem_support_height); } } diff --git a/src/stems/c64.scad b/src/stems/c64.scad index 052d3cc..7dc6507 100644 --- a/src/stems/c64.scad +++ b/src/stems/c64.scad @@ -14,6 +14,14 @@ module inside_c64_cross(slop) { } } + // inner portion of the cross, c64 stems are thicker halfway to ensure keys stay put + translate([0,0,1.95]) { + linear_extrude(height = 0.6) { + square(c64_inner_cross(slop, extra_vertical)[0], center=true); + square(c64_inner_cross(slop, extra_vertical)[1], center=true); + } + } + // Guides to assist insertion and mitigate first layer squishing if ($c64_bevel){ for (i = c64_cross(slop, extra_vertical)) hull() { @@ -24,13 +32,10 @@ module inside_c64_cross(slop) { } module c64_stem(depth, slop, throw) { + difference(){ + cylinder(d=$c64_stem_d, h=depth); // outside shape - linear_extrude(height = depth) { - offset(r=1){ - square(outer_c64_stem(slop) - [2,2], center=true); - } - } inside_c64_cross($stem_inner_slop); } From 68450399422d032c8e3cd00c03cbba965f43ccfd Mon Sep 17 00:00:00 2001 From: Kuba Tyszko Date: Mon, 14 Dec 2020 09:54:43 -0800 Subject: [PATCH 3/5] Keyset for Commodore 64 - based on SA profile, no PETSCII legends --- examples/commodore_64_keyset.scad | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 examples/commodore_64_keyset.scad diff --git a/examples/commodore_64_keyset.scad b/examples/commodore_64_keyset.scad new file mode 100644 index 0000000..4b2a3cf --- /dev/null +++ b/examples/commodore_64_keyset.scad @@ -0,0 +1,4 @@ +include <./includes.scad> + +c64_default("sa") c64() key(); + From d59109d6e0ca210d97a8bf125b1dfe75fb74f842 Mon Sep 17 00:00:00 2001 From: Kuba Tyszko Date: Mon, 14 Dec 2020 09:55:41 -0800 Subject: [PATCH 4/5] Keyset for Commodore 64 - based on SA profile, no PETSCII legends --- examples/commodore_64_keyset.scat | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 examples/commodore_64_keyset.scat diff --git a/examples/commodore_64_keyset.scat b/examples/commodore_64_keyset.scat deleted file mode 100644 index 4b2a3cf..0000000 --- a/examples/commodore_64_keyset.scat +++ /dev/null @@ -1,4 +0,0 @@ -include <./includes.scad> - -c64_default("sa") c64() key(); - From cd3d76a5a3cd5643f518e64013c2dbd75f9034b7 Mon Sep 17 00:00:00 2001 From: Kuba Tyszko Date: Mon, 14 Dec 2020 10:05:41 -0800 Subject: [PATCH 5/5] Keyset for Commodore 64 - based on SA profile, no PETSCII legends --- examples/commodore_64_keyset.scad | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/commodore_64_keyset.scad b/examples/commodore_64_keyset.scad index 4b2a3cf..b02d657 100644 --- a/examples/commodore_64_keyset.scad +++ b/examples/commodore_64_keyset.scad @@ -1,4 +1,5 @@ -include <./includes.scad> - -c64_default("sa") c64() key(); +include <../includes.scad> +//c64_default("sa") c64() key(); +//c64_prusai3_right("sa" ) c64() key(); +c64_prusai3_left("sa" ) c64() key();