mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2025-02-18 07:10:22 +00:00
should really have a changelog huh
This commit is contained in:
parent
44da611cdd
commit
43e20beaaa
8 changed files with 7829 additions and 71219 deletions
64
dishes.scad
64
dishes.scad
|
@ -1,50 +1,64 @@
|
||||||
module cylindrical_dish(top_total_key_width, dish_depth, inverted_dish, top_tilt){
|
include <util.scad>
|
||||||
|
//rounding factor. increase rounding on dishes
|
||||||
|
$rounding_factor = 1;
|
||||||
|
|
||||||
|
|
||||||
|
module cylindrical_dish(width, height, depth, inverted, tilt){
|
||||||
|
// .5 has problems starting around 3u
|
||||||
|
$fa=.25;
|
||||||
/* we do some funky math here
|
/* we do some funky math here
|
||||||
* basically you want to have the dish "dig in" to the keycap x millimeters
|
* basically you want to have the dish "dig in" to the keycap x millimeters
|
||||||
* in order to do that you have to solve a small (2d) system of equations
|
* in order to do that you have to solve a small (2d) system of equations
|
||||||
* where the chord of the spherical cross section of the dish is
|
* where the chord of the spherical cross section of the dish is
|
||||||
* the width of the keycap.
|
* the width of the keycap.
|
||||||
*/
|
*/
|
||||||
// the distance you have to move the dish so it digs in dish_depth millimeters
|
// the distance you have to move the dish so it digs in depth millimeters
|
||||||
chord_length = (pow(top_total_key_width, 2) - 4 * pow(dish_depth, 2)) / (8 * dish_depth);
|
chord_length = (pow(width, 2) - 4 * pow(depth, 2)) / (8 * depth);
|
||||||
//the radius of the dish
|
//the radius of the dish
|
||||||
rad = (pow(top_total_key_width, 2) + 4 * pow(dish_depth, 2)) / (8 * dish_depth);
|
rad = (pow(width, 2) + 4 * pow(depth, 2)) / (8 * depth);
|
||||||
direction = inverted_dish ? -1 : 1;
|
direction = inverted ? -1 : 1;
|
||||||
|
|
||||||
rotate([90-top_tilt,0,0]){
|
rotate([90-tilt,0,0]){
|
||||||
translate([0,chord_length * direction,0]){
|
translate([0,chord_length * direction,0]){
|
||||||
cylinder(h=100,r=rad, $fn=1024, center=true);
|
cylinder(h=height + 20, r=rad, center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module spherical_dish(top_total_key_width, dish_depth, inverted_dish, top_tilt){
|
module spherical_dish(width, height, depth, inverted, tilt, txt=""){
|
||||||
|
// honestly 1 has problems around 6.25 but its already ridiculously slow
|
||||||
|
$fa=3;
|
||||||
//same thing as the cylindrical dish here, but we need the corners to just touch - so we have to find the hypotenuse of the top
|
//same thing as the cylindrical dish here, but we need the corners to just touch - so we have to find the hypotenuse of the top
|
||||||
chord = pow((pow(top_total_key_width,2) + pow(top_total_key_height(), 2)),0.5); //getting diagonal of the top
|
chord = pow((pow(width,2) + pow(height, 2)),0.5); //getting diagonal of the top
|
||||||
|
|
||||||
// the distance you have to move the dish up so it digs in dish_depth millimeters
|
// the distance you have to move the dish up so it digs in depth millimeters
|
||||||
chord_length = (pow(chord, 2) - 4 * pow(dish_depth, 2)) / (8 * dish_depth);
|
chord_length = (pow(chord, 2) - 4 * pow(depth, 2)) / (8 * depth);
|
||||||
//the radius of the dish
|
//the radius of the dish
|
||||||
rad = (pow(chord, 2) + 4 * pow(dish_depth, 2)) / (8 * dish_depth);
|
rad = (pow(chord, 2) + 4 * pow(depth, 2)) / (8 * depth);
|
||||||
direction = inverted_dish ? -1 : 1;
|
direction = inverted ? -1 : 1;
|
||||||
|
|
||||||
rotate([-top_tilt,0,0]){
|
/*intersection(){*/
|
||||||
translate([0,0,chord_length * direction]){
|
rotate([-tilt,0,0]){
|
||||||
//NOTE: if your dish is long at all you might need to increase $fn
|
translate([0,0,chord_length * direction]){
|
||||||
sphere(r=rad, $fn=512);
|
//NOTE: if your dish is long at all you might need to increase $fn
|
||||||
}
|
sphere(r=rad);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// this line causes openscad to die. maybe re-enable when that doesn't happen instead of differencing the inside() when we add the dish to the shape()
|
||||||
|
/*translate([0,0,0]) roundedRect([width, height, depth], 1.5);*/
|
||||||
|
/*}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
module sideways_cylindrical_dish(top_total_key_width, dish_depth, inverted_dish, top_tilt){
|
module sideways_cylindrical_dish(width, height, depth, inverted, tilt){
|
||||||
chord_length = (pow(top_total_key_height(), 2) - 4 * pow(dish_depth, 2)) / (8 * dish_depth);
|
$fa=1;
|
||||||
rad = (pow(top_total_key_height(), 2) + 4 * pow(dish_depth, 2)) / (8 * dish_depth);
|
chord_length = (pow(height, 2) - 4 * pow(depth, 2)) / (8 * depth);
|
||||||
|
rad = (pow(height, 2) + 4 * pow(depth, 2)) / (8 * depth);
|
||||||
|
|
||||||
direction = inverted_dish ? -1 : 1;
|
direction = inverted ? -1 : 1;
|
||||||
|
|
||||||
rotate([90,top_tilt,90]){
|
rotate([90,tilt,90]){
|
||||||
translate([0,chord_length * direction,0]){
|
translate([0,chord_length * direction,0]){
|
||||||
cylinder(h=total_key_width + 20,r=rad, $fn=1024, center=true); // +20 just cuz
|
cylinder(h = width + 20,r=rad, center=true); // +20 for fudge factor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
167
key.scad
167
key.scad
|
@ -1,4 +1,3 @@
|
||||||
include <variables.scad>
|
|
||||||
include <util.scad>
|
include <util.scad>
|
||||||
include <stems.scad>
|
include <stems.scad>
|
||||||
include <dishes.scad>
|
include <dishes.scad>
|
||||||
|
@ -15,12 +14,14 @@ brim_radius = 8;
|
||||||
brim_depth = .3;
|
brim_depth = .3;
|
||||||
//whether stabilizer connectors are enabled
|
//whether stabilizer connectors are enabled
|
||||||
stabilizers = false;
|
stabilizers = false;
|
||||||
// how inset the stem is from the bottom of the key. experimental. requires support
|
|
||||||
stem_inset = 0;
|
|
||||||
// stem offset in units NOT MM. for stepped caps lock basically
|
// stem offset in units NOT MM. for stepped caps lock basically
|
||||||
stem_offset = 0;
|
stem_offset = 0;
|
||||||
|
// font used for text
|
||||||
|
font="Arial";
|
||||||
|
// font size used for text
|
||||||
|
font_size = 8;
|
||||||
|
// whether or not to render fake keyswitches to check clearances
|
||||||
|
clearance_check = true;
|
||||||
|
|
||||||
/* [Key profile] */
|
/* [Key profile] */
|
||||||
|
|
||||||
|
@ -62,19 +63,31 @@ connectors = stabilizers ? [[0,0],[-50,0],[50,0]] : [[0,0]];
|
||||||
ISOEnter = false;
|
ISOEnter = false;
|
||||||
//should the key be rounded? unnecessary for most printers, and very slow
|
//should the key be rounded? unnecessary for most printers, and very slow
|
||||||
rounded_key = false;
|
rounded_key = false;
|
||||||
// cherry MX or Alps stem, or totally broken circular cherry stem [0..2]
|
// 'cherry', 'alps' or 'cherry_rounded'
|
||||||
stem_profile = 0;
|
stem_profile = "cherry";
|
||||||
|
// how much higher the stem is than the bottom of the keycap.
|
||||||
|
// inset stem requires support but is more accurate in some profiles
|
||||||
|
stem_inset = 0;
|
||||||
|
// how many degrees to rotate the stems. useful for sideways keycaps, maybe
|
||||||
|
stem_rotation = 0;
|
||||||
|
//text to be rendered in the center of the key, if any
|
||||||
|
text = "";
|
||||||
|
// is the text on the key inset? inset text is still experimental
|
||||||
|
inset_text = false;
|
||||||
|
|
||||||
|
|
||||||
/* [Hidden] */
|
/* [Hidden] */
|
||||||
//change to round things better
|
$fs = .1;
|
||||||
$fn = 32;
|
|
||||||
//beginning to use unit instead of baked in 19.05
|
//beginning to use unit instead of baked in 19.05
|
||||||
unit = 19.05;
|
unit = 19.05;
|
||||||
//minkowski radius. radius of sphere used in minkowski sum for minkowski_key function. 1.75 default for faux G20
|
//minkowski radius. radius of sphere used in minkowski sum for minkowski_key function. 1.75 default for faux G20
|
||||||
minkowski_radius = 1.75;
|
minkowski_radius = 1.75;
|
||||||
|
//radius of corners of keycap
|
||||||
|
corner_radius = 1.5;
|
||||||
|
|
||||||
|
|
||||||
// derived variables
|
|
||||||
|
// derived functions. can't be variables if we want them to change when the special variables do
|
||||||
|
|
||||||
// actual mm key width and height
|
// actual mm key width and height
|
||||||
function total_key_width() = $bottom_key_width + (unit * ($key_length - 1));
|
function total_key_width() = $bottom_key_width + (unit * ($key_length - 1));
|
||||||
|
@ -103,19 +116,23 @@ module outside(thickness_difference){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//key shape including dish. used as the ouside and inside shape in key()
|
// key shape including dish. used as the ouside and inside shape in key()
|
||||||
module shape(thickness_difference, depth_difference){
|
module shape(thickness_difference, depth_difference){
|
||||||
difference(){
|
difference(){
|
||||||
union(){
|
union(){
|
||||||
shape_hull(thickness_difference, depth_difference, 1);
|
shape_hull(thickness_difference, depth_difference, 1);
|
||||||
if ($inverted_dish) { dish(depth_difference); }
|
if ($inverted_dish) { dish(depth_difference); }
|
||||||
}
|
}
|
||||||
if (!$inverted_dish) { dish(depth_difference); }
|
if (!$inverted_dish) {
|
||||||
outside(thickness_difference);
|
dish(depth_difference);
|
||||||
|
} else {
|
||||||
|
// needed to trim the edges of an inverted dish
|
||||||
|
inside();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// shape of the key but with soft, rounded edges. much more realistic, much more complex
|
// shape of the key but with soft, rounded edges. much more realistic, MUCH more complex. orders of magnitude more complex
|
||||||
module rounded_shape() {
|
module rounded_shape() {
|
||||||
minkowski(){
|
minkowski(){
|
||||||
shape(minkowski_radius*2, minkowski_radius);
|
shape(minkowski_radius*2, minkowski_radius);
|
||||||
|
@ -139,7 +156,7 @@ module shape_hull(thickness_difference, depth_difference, modifier){
|
||||||
// $bottom_key_width + ($key_length -1) * unit is the correct length of the
|
// $bottom_key_width + ($key_length -1) * unit is the correct length of the
|
||||||
// key. only 1u of the key should be $bottom_key_width long; all others
|
// key. only 1u of the key should be $bottom_key_width long; all others
|
||||||
// should be 1u
|
// should be 1u
|
||||||
roundedRect([total_key_width() - thickness_difference, total_key_height() - thickness_difference, .001],1.5);
|
roundedRect([total_key_width() - thickness_difference, total_key_height() - thickness_difference, .001],corner_radius);
|
||||||
|
|
||||||
//depth_difference outside of modifier because that doesnt make sense
|
//depth_difference outside of modifier because that doesnt make sense
|
||||||
translate([0,$top_skew,$total_depth * modifier - depth_difference]){
|
translate([0,$top_skew,$total_depth * modifier - depth_difference]){
|
||||||
|
@ -148,7 +165,7 @@ module shape_hull(thickness_difference, depth_difference, modifier){
|
||||||
total_key_width() - thickness_difference - $width_difference * modifier,
|
total_key_width() - thickness_difference - $width_difference * modifier,
|
||||||
total_key_height() - thickness_difference - $height_difference * modifier,
|
total_key_height() - thickness_difference - $height_difference * modifier,
|
||||||
.001
|
.001
|
||||||
],1.5);
|
],corner_radius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,39 +175,65 @@ module shape_hull(thickness_difference, depth_difference, modifier){
|
||||||
//dish selector
|
//dish selector
|
||||||
module dish(depth_difference){
|
module dish(depth_difference){
|
||||||
translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
|
translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - depth_difference]){
|
||||||
if($dish_type == 0){ // cylindrical dish
|
if($dish_type == 0){
|
||||||
cylindrical_dish(top_total_key_width(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
cylindrical_dish(top_total_key_width(), top_total_key_height(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
||||||
}
|
}
|
||||||
else if ($dish_type == 1) { // spherical dish
|
else if ($dish_type == 1) {
|
||||||
spherical_dish(top_total_key_width(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
spherical_dish(top_total_key_width(), top_total_key_height(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
||||||
}
|
}
|
||||||
else if ($dish_type == 2){ // SIDEWAYS cylindrical dish - used for spacebar
|
else if ($dish_type == 2){
|
||||||
sideways_cylindrical_dish(top_total_key_width(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
sideways_cylindrical_dish(top_total_key_width(), top_total_key_height(), $dish_depth, $inverted_dish, $top_tilt / $key_height);
|
||||||
}
|
}
|
||||||
// else no dish
|
// else no dish
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//whole connector, alps or cherry, trimmed to fit
|
module keytext() {
|
||||||
module connector(){
|
extra_dish_depth = ($dish_type > 2) ? 0 : $dish_depth;
|
||||||
difference(){
|
extra_inset_depth = ($inset_text) ? keytop_thickness/4 : 0;
|
||||||
if($stem_profile == 0) {
|
|
||||||
cherry_stem();
|
translate([$dish_skew_x, $top_skew + $dish_skew_y, $total_depth - extra_dish_depth - extra_inset_depth]){
|
||||||
} else if ($stem_profile == 1) {
|
rotate([-$top_tilt,0,0]){
|
||||||
alps_stem();
|
linear_extrude(height=$dish_depth){
|
||||||
} else if ($stem_profile == 2) {
|
text(text=$text, font=font, size=font_size, halign="center", valign="center");
|
||||||
cherry_stem_rounded();
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module connectors($stem_profile) {
|
||||||
|
difference() {
|
||||||
|
for (connector_pos = $connectors) {
|
||||||
|
translate([connector_pos[0], connector_pos[1], $stem_inset]) {
|
||||||
|
rotate([0, 0, $stem_rotation]){
|
||||||
|
connector($stem_profile);
|
||||||
|
if ($has_brim) cylinder(r=brim_radius,h=brim_depth);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
inside();
|
inside();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module brim() {
|
//approximate (fully depressed) cherry key to check clearances
|
||||||
cylinder(r=brim_radius,h=brim_depth);
|
module clearance_check() {
|
||||||
|
if(clearance_check == true && ($stem_profile == "cherry" || $stem_profile == "cherry_rounded")){
|
||||||
|
color([1,0,0, 0.5]){
|
||||||
|
translate([0,0,3.6 + $stem_inset - 5]) {
|
||||||
|
%hull() {
|
||||||
|
cube([15.6, 15.6, 0.01], center=true);
|
||||||
|
translate([0,1,5 - 0.01]) cube([10.5,9.5, 0.01], center=true);
|
||||||
|
}
|
||||||
|
%hull() {
|
||||||
|
cube([15.6, 15.6, 0.01], center=true);
|
||||||
|
translate([0,0,-5.5]) cube([13.5,13.5,0.01], center=true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module keytop() {
|
module keytop() {
|
||||||
echo($key_length);
|
|
||||||
difference(){
|
difference(){
|
||||||
if ($rounded_key) {
|
if ($rounded_key) {
|
||||||
rounded_shape();
|
rounded_shape();
|
||||||
|
@ -201,9 +244,24 @@ module keytop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//actual full key with space carved out and keystem/stabilizer connectors
|
|
||||||
|
// The final, penultimate key generation function.
|
||||||
|
// takes all the bits and glues them together. requires configuration with special variables.
|
||||||
|
module key() {
|
||||||
|
difference() {
|
||||||
|
union(){
|
||||||
|
keytop();
|
||||||
|
if($stem_profile != "blank") connectors($stem_profile);
|
||||||
|
if(!$inset_text) keytext();
|
||||||
|
clearance_check();
|
||||||
|
}
|
||||||
|
if ($inset_text) keytext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// actual full key with space carved out and keystem/stabilizer connectors
|
||||||
// this is an example key with all the fixins
|
// this is an example key with all the fixins
|
||||||
module key(){
|
module example_key(){
|
||||||
$bottom_key_width = bottom_key_width;
|
$bottom_key_width = bottom_key_width;
|
||||||
$bottom_key_height = bottom_key_height;
|
$bottom_key_height = bottom_key_height;
|
||||||
$width_difference = width_difference;
|
$width_difference = width_difference;
|
||||||
|
@ -223,32 +281,31 @@ module key(){
|
||||||
$ISOEnter = ISOEnter;
|
$ISOEnter = ISOEnter;
|
||||||
$rounded_key = rounded_key;
|
$rounded_key = rounded_key;
|
||||||
$stem_profile = stem_profile;
|
$stem_profile = stem_profile;
|
||||||
|
$stem_inset = stem_inset;
|
||||||
|
$stem_rotation = stem_rotation;
|
||||||
|
$text = text;
|
||||||
|
$inset_text = inset_text;
|
||||||
|
|
||||||
|
|
||||||
keytop();
|
|
||||||
|
|
||||||
//TODO this stem offset thing is weird here. find a better place for it. its for stepped caps lock
|
|
||||||
translate([-unit * stem_offset, 0, 0]){
|
|
||||||
for (x = $connectors) {
|
|
||||||
translate(x) connector();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($has_brim){
|
|
||||||
brim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ACTUAL OUTPUT
|
|
||||||
difference(){
|
|
||||||
key();
|
key();
|
||||||
// preview cube, for seeing inside the keycap
|
|
||||||
//cube([100,100,100]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example_key();
|
||||||
//minkowski_key();
|
//minkowski_key();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Experimental stuff
|
// Experimental stuff
|
||||||
|
|
||||||
// NOT 3D, NOT CENTERED
|
// NOT 3D, NOT CENTERED
|
||||||
|
|
18384
key.scad.stl
18384
key.scad.stl
File diff suppressed because it is too large
Load diff
BIN
key_v2.zip
Normal file
BIN
key_v2.zip
Normal file
Binary file not shown.
215
keys.scad
215
keys.scad
|
@ -1,3 +1,12 @@
|
||||||
|
/* TODO:
|
||||||
|
* can now measure keycaps very accurately. need to redo measurements
|
||||||
|
* sideways cylindrical dish needs to be used for some spacebars but not others. currently none of them use it
|
||||||
|
* Add inset stem to all profiles that need it
|
||||||
|
* Pregenerated keysets
|
||||||
|
* Full experimental ISO enter
|
||||||
|
* customizer version where everything is copy/pasted in
|
||||||
|
*/
|
||||||
|
|
||||||
use <key.scad>
|
use <key.scad>
|
||||||
//TODO duplicate def to not make this a special var. maybe not worth it
|
//TODO duplicate def to not make this a special var. maybe not worth it
|
||||||
unit = 19.05;
|
unit = 19.05;
|
||||||
|
@ -22,46 +31,42 @@ $connectors = [[0,0]];
|
||||||
$ISOEnter = false;
|
$ISOEnter = false;
|
||||||
$rounded_key = false;
|
$rounded_key = false;
|
||||||
$stem_profile = 0;
|
$stem_profile = 0;
|
||||||
|
$stem_inset = 0;
|
||||||
|
$stem_rotation = 0;
|
||||||
|
|
||||||
// key profile definitions
|
// key profile definitions
|
||||||
|
|
||||||
module dcs_row(n=1) {
|
module dcs_row(n=1) {
|
||||||
echo(n);
|
|
||||||
// names, so I don't go crazy
|
// names, so I don't go crazy
|
||||||
$bottom_key_width = 18.16;
|
$bottom_key_width = 18.16;
|
||||||
$bottom_key_height = 18.16;
|
$bottom_key_height = 18.16;
|
||||||
$width_difference = 6;
|
$width_difference = 6;
|
||||||
$height_difference = 4;
|
$height_difference = 4;
|
||||||
$dish_type = 0;
|
$dish_type = 2;
|
||||||
$dish_depth = 1;
|
$dish_depth = 1;
|
||||||
$dish_skew_x = 0;
|
$dish_skew_x = 0;
|
||||||
$dish_skew_y = 0;
|
$dish_skew_y = 0;
|
||||||
|
$top_skew = 1.75;
|
||||||
|
|
||||||
if (n == 5) {
|
if (n == 5) {
|
||||||
$total_depth = 11.5;
|
$total_depth = 11.5;
|
||||||
$top_tilt = -6;
|
$top_tilt = -6;
|
||||||
$top_skew = 1.7;
|
|
||||||
children();
|
children();
|
||||||
} else if (n == 1) {
|
} else if (n == 1) {
|
||||||
$total_depth = 8.5;
|
$total_depth = 8.5;
|
||||||
$top_tilt = -1;
|
$top_tilt = -1;
|
||||||
$top_skew = 1.75;
|
|
||||||
children();
|
children();
|
||||||
} else if (n == 2) {
|
} else if (n == 2) {
|
||||||
$total_depth = 7.5;
|
$total_depth = 7.5;
|
||||||
$top_tilt = 3;
|
$top_tilt = 3;
|
||||||
$top_skew = 1.75;
|
|
||||||
children();
|
children();
|
||||||
} else if (n == 3) {
|
} else if (n == 3) {
|
||||||
$total_depth = 6;
|
$total_depth = 6;
|
||||||
$top_tilt = 7;
|
$top_tilt = 7;
|
||||||
$top_skew = 1.75;
|
|
||||||
children();
|
children();
|
||||||
} else if (n == 4) {
|
} else if (n == 4) {
|
||||||
$total_depth = 6;
|
$total_depth = 6;
|
||||||
$top_tilt = 16;
|
$top_tilt = 16;
|
||||||
$top_skew = 1.75;
|
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +77,7 @@ module dsa_row(n=3) {
|
||||||
$width_difference = 5.7;
|
$width_difference = 5.7;
|
||||||
$height_difference = 5.7;
|
$height_difference = 5.7;
|
||||||
$total_depth = 7.4;
|
$total_depth = 7.4;
|
||||||
$top_tilt = 0;
|
$top_tilt = (n-1) * 7 - 14;
|
||||||
$top_skew = 0;
|
$top_skew = 0;
|
||||||
$dish_type = 1;
|
$dish_type = 1;
|
||||||
$dish_depth = 1.2;
|
$dish_depth = 1.2;
|
||||||
|
@ -88,29 +93,26 @@ module sa_row(n=1) {
|
||||||
$width_difference = 5.7;
|
$width_difference = 5.7;
|
||||||
$height_difference = 5.7;
|
$height_difference = 5.7;
|
||||||
$dish_type = 1;
|
$dish_type = 1;
|
||||||
$dish_depth = 1.2;
|
$dish_depth = 0.85;
|
||||||
$dish_skew_x = 0;
|
$dish_skew_x = 0;
|
||||||
$dish_skew_y = 0;
|
$dish_skew_y = 0;
|
||||||
|
$top_skew = 0;
|
||||||
|
|
||||||
if (n == 1){
|
if (n == 1){
|
||||||
$total_depth = 13.73;
|
$total_depth = 14.89;
|
||||||
$top_tilt = -14;
|
$top_tilt = -13;
|
||||||
$top_skew = 0;
|
|
||||||
children();
|
children();
|
||||||
} else if (n == 2) {
|
} else if (n == 2) {
|
||||||
$total_depth = 11.73;
|
$total_depth = 12.925;
|
||||||
$top_tilt = -7;
|
$top_tilt = -7;
|
||||||
$top_skew = 0;
|
|
||||||
children();
|
children();
|
||||||
} else if (n == 3) {
|
} else if (n == 3) {
|
||||||
$total_depth = 11.73;
|
$total_depth = 12.5;
|
||||||
$top_tilt = 0;
|
$top_tilt = 0;
|
||||||
$top_skew = 0;
|
|
||||||
children();
|
children();
|
||||||
} else if (n == 4){
|
} else if (n == 4){
|
||||||
$total_depth = 11.73;
|
$total_depth = 12.925;
|
||||||
$top_tilt = 7;
|
$top_tilt = 7;
|
||||||
$top_skew = 0;
|
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +151,7 @@ module fake_iso_enter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
module brimmed() {
|
module brimmed() {
|
||||||
brim();
|
$has_brim = true;
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,93 +165,111 @@ module inverted() {
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module spacebar() {
|
module stabilized(mm=12, vertical = false) {
|
||||||
$inverted_dish = true;
|
if (vertical) {
|
||||||
$key_length = 6.25;
|
$connectors = [
|
||||||
//TODO CONFIRM PLS
|
[0, 0],
|
||||||
$connectors = [[0,0],[-50,0],[50,0]];
|
[0, mm],
|
||||||
|
[0, -mm]
|
||||||
|
];
|
||||||
|
|
||||||
|
children();
|
||||||
|
} else {
|
||||||
|
$connectors = [
|
||||||
|
[0, 0],
|
||||||
|
[mm, 0],
|
||||||
|
[-mm, 0]
|
||||||
|
];
|
||||||
|
|
||||||
|
children();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module dishless() {
|
||||||
|
$dish_type = 3;
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module spacebar() {
|
||||||
|
$inverted_dish = true;
|
||||||
|
6_25u() stabilized(mm=50) children();
|
||||||
|
}
|
||||||
|
|
||||||
module lshift() {
|
module lshift() {
|
||||||
//TODO
|
2_25u() stabilized() children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module rshift() {
|
module rshift() {
|
||||||
//TODO
|
2_75u() stabilized() children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module backspace() {
|
module backspace() {
|
||||||
//TODO
|
2u() stabilized() children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module enter() {
|
module enter() {
|
||||||
//TODO
|
2_25u() stabilized() children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module numpad_enter() {
|
module numpad_enter() {
|
||||||
//TODO
|
2uh() stabilized(vertical=true) children();
|
||||||
|
}
|
||||||
|
|
||||||
|
module numpad_plus() {
|
||||||
|
numpad_enter() children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module numpad_0() {
|
module numpad_0() {
|
||||||
//TODO
|
backspace() children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module translate_u(x=0, y=0){
|
module stepped_caps_lock() {
|
||||||
echo (x*unit);
|
u(1.75) {
|
||||||
translate([x * unit, y*unit, 0]) {
|
$connectors = [
|
||||||
|
[-5, 0]
|
||||||
|
];
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module translate_u(x=0, y=0, z=0){
|
||||||
|
translate([x * unit, y*unit, z*unit]) children();
|
||||||
|
}
|
||||||
|
|
||||||
// key width functions
|
// key width functions
|
||||||
|
|
||||||
module u(u=1) {
|
module u(u=1) {
|
||||||
$key_length = u;
|
$key_length = u;
|
||||||
echo ($key_length);
|
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module 1u() {
|
module 1u() {
|
||||||
u(1){
|
u(1) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 2u() {
|
|
||||||
u(2){
|
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module 1_25u() {
|
module 1_25u() {
|
||||||
u(1.25){
|
u(1.25) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 1_5u() {
|
module 1_5u() {
|
||||||
u(1.5){
|
u(1.5) children();
|
||||||
children();
|
}
|
||||||
}
|
|
||||||
|
module 2u() {
|
||||||
|
u(2) children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module 2_25u() {
|
module 2_25u() {
|
||||||
u(2.25){
|
u(2.25) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 2_75u() {
|
module 2_75u() {
|
||||||
u(2.75){
|
u(2.75) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 6_25u() {
|
module 6_25u() {
|
||||||
u(6.25){
|
u(6.25) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// key height functions
|
// key height functions
|
||||||
|
@ -260,76 +280,63 @@ module uh(u=1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
module 1uh() {
|
module 1uh() {
|
||||||
uh(1){
|
uh(1) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 2uh() {
|
module 2uh() {
|
||||||
uh(2){
|
uh(2) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 1_25uh() {
|
module 1_25uh() {
|
||||||
uh(1.25){
|
uh(1.25) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 1_5uh() {
|
module 1_5uh() {
|
||||||
uh(1.5){
|
uh(1.5) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 2_25uh() {
|
module 2_25uh() {
|
||||||
uh(2.25){
|
uh(2.25) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 2_75uh() {
|
module 2_75uh() {
|
||||||
uh(2.75){
|
uh(2.75) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module 6_25uh() {
|
module 6_25uh() {
|
||||||
uh(6.25){
|
uh(6.25) children();
|
||||||
children();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module cherry_key() {
|
module blank() {
|
||||||
difference() {
|
$stem_profile = "blank";
|
||||||
cherry_stem();
|
children();
|
||||||
inside();
|
|
||||||
}
|
|
||||||
|
|
||||||
keytop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module alps_key() {
|
module cherry() {
|
||||||
difference(){
|
$stem_profile = "cherry";
|
||||||
alps_stem();
|
children();
|
||||||
inside();
|
|
||||||
}
|
|
||||||
|
|
||||||
keytop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module rounded_cherry_key() {
|
module alps() {
|
||||||
difference(){
|
$stem_profile = "alps";
|
||||||
cherry_stem_rounded();
|
children();
|
||||||
inside();
|
|
||||||
}
|
|
||||||
|
|
||||||
keytop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (row=[1:4]) {
|
module rounded_cherry() {
|
||||||
for (column = [1:1]) {
|
$stem_profile = "cherry_rounded";
|
||||||
translate_u(column - 1, 4 - row) dcs_row(row) alps_key();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module legend(text, inset=false) {
|
||||||
|
$text=text;
|
||||||
|
$inset_text = inset;
|
||||||
|
}
|
||||||
|
|
||||||
|
translate([0,0,0]){
|
||||||
|
for (x = [1:4]){
|
||||||
|
translate_u(0,(x-1)){
|
||||||
|
sa_row(5-x) blank() key();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
translate([-10,-10,-2]) cube([40,80,2]);
|
||||||
}
|
}
|
||||||
|
|
60202
keys.scad.stl
60202
keys.scad.stl
File diff suppressed because it is too large
Load diff
16
stems.scad
16
stems.scad
|
@ -1,6 +1,4 @@
|
||||||
include <variables.scad>
|
cross_height = 25;
|
||||||
|
|
||||||
cross_height = 15;
|
|
||||||
|
|
||||||
module cherry_stem() {
|
module cherry_stem() {
|
||||||
cherry_stem_base();
|
cherry_stem_base();
|
||||||
|
@ -86,3 +84,15 @@ module alps_stem(){
|
||||||
cube([width,height,cross_depth], center = true);
|
cube([width,height,cross_depth], center = true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//whole connector, alps or cherry, trimmed to fit
|
||||||
|
module connector(stem_profile){
|
||||||
|
if (stem_profile == "alps") {
|
||||||
|
alps_stem();
|
||||||
|
} else if (stem_profile == "cherry_rounded") {
|
||||||
|
cherry_stem_rounded();
|
||||||
|
} else if (stem_profile == "cherry") {
|
||||||
|
cherry_stem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue