add newly generated base models

This commit is contained in:
Bob - Home - Windows 2018-02-12 21:36:36 -05:00
parent aa795c4958
commit 911543bea4
9 changed files with 63 additions and 53 deletions

View File

@ -124,8 +124,6 @@ That's it, if you have any questions feel free to open an issue or leave a comme
## TODO: ## TODO:
* pull out side sculpting options to let people tweak them? * replace linear_extrude_shape_hull with skin_extrude_shape_hull or something
* can now measure keycaps very accurately. need to redo measurements: [x] SA [ ] DCS [X] DSA [X] OEM? * replace current ISO enter shape with one that works for `skin()`
* Add inset stem to all profiles that need it. [x] OEM [ ] DCS?
* customizer version where everything is copy/pasted in. needs to be last.
* generate dishes via math? kind of hard, maybe later * generate dishes via math? kind of hard, maybe later

View File

@ -20,29 +20,24 @@ module translate_u(x=0, y=0, z=0){
translate([x * unit, y*unit, z*unit]) children(); translate([x * unit, y*unit, z*unit]) children();
} }
// basic // row 5 is commonly the top row, for whatever reason
cherry() key(); key_profiles = ["dcs", "oem", "sa", "g20", "dsa"];
translate_u(1) sa_row(2) cherry() key("q"); module one_single_key(profile, row, unsculpted) {
translate_u(2) oem_row(2) alps() key("q", inset=true); key_profile(profile, unsculpted ? 3 : row) cherry() key();
translate_u(3) dsa_row() flat_support() rounded_cherry() key();
translate_u(1, 1) sa_row(3) lshift() cherry() key(inset=true) {
sphere(1);
};
translate_u(3, 2) sa_row(3) bar_support() spacebar() cherry() key("space bar");
translate_u(3,1) sa_row(3) 2u() cherry() {
$key_shape_type = "oblong";
$support_type = false;
$inverted_dish = true;
key();
} }
module one_row_profile(profile, unsculpted = false) {
rows = [5, 1, 2, 3, 4];
for(row = [0:len(rows)-1]) {
translate_u(0, -row) one_single_key(profile, rows[row], unsculpted);
}
}
/* // g20 / dsa sculpting test for (p = [0:len(key_profiles)-1]) {
for (x = [1:5]) { translate_u(p){
translate_u(0, x) dsa_row(x) cherry() key(); /* one_row_profile(key_profiles[p]); */
translate_u(1, x) g20_row(x) cherry() key(); }
} */ }
/* translate_u(0, 0) one_row_profile("oem"); */

View File

@ -19,14 +19,17 @@ for (row = [0:len(60_percent)-1]){
for(column = [0:len(60_percent[row])-1]) { for(column = [0:len(60_percent[row])-1]) {
columnDist = sum([for (x = [0 : column]) 60_percent[row][x]]); columnDist = sum([for (x = [0 : column]) 60_percent[row][x]]);
a = 60_percent[row][column]; a = 60_percent[row][column];
translate_u(columnDist - (a/2), -row) dishless() dcs_row((row+4) % 5 + 1) u(a) cherry() { translate_u(columnDist - (a/2), -row) g20_row(3) u(a) cherry() { // (row+4) % 5 + 1
$width_difference = 0; if (a == 6.25) {
$height_difference = 0;
$key_shape_type = "spherical";
if (a != 6.25) {
key();
} else {
spacebar() key(); spacebar() key();
} else if (a == 2.25) {
lshift() key();
} else if (a == 2) {
backspace() key();
} else if (a == 2.75) {
rshift() key();
} else {
key();
} }
} }
} }

View File

@ -16,10 +16,10 @@ module spherical_dish(width, height, depth, inverted){
geodesic_sphere(r=depth); geodesic_sphere(r=depth);
} }
} else { } else {
$fa=7; $fa=6.5;
// rotate 1 because the bottom of the sphere looks like trash. // rotate 1 because the bottom of the sphere looks like trash.
scale([chord/2/depth, chord/2/depth]) { scale([chord/2/depth, chord/2/depth]) {
geodesic_sphere(r=depth); sphere(r=depth);
} }
} }
} }

View File

@ -13,7 +13,7 @@ color1 = [.2667,.5882,1];
color2 = [.5412, .4784, 1]; color2 = [.5412, .4784, 1];
color3 = [.4078, .3569, .749]; color3 = [.4078, .3569, .749];
color4 = [1, .6941, .2]; color4 = [1, .6941, .2];
transparent_red = [1,0,0, 0.5]; transparent_red = [1,0,0, 0.15];
// derived values. can't be variables if we want them to change when the special variables do // derived values. can't be variables if we want them to change when the special variables do
@ -29,21 +29,19 @@ function top_total_key_height() = $bottom_key_height + (unit * ($key_height - 1)
// key shape including dish. used as the ouside and inside shape in keytop(). allows for itself to be shrunk in depth and width / height // 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){
dished(depth_difference, $inverted_dish) { dished(depth_difference, $inverted_dish) {
color(color1) shape_hull(thickness_difference, depth_difference, 1); color(color1) shape_hull(thickness_difference, depth_difference, 2);
} }
} }
// shape of the key but with soft, rounded edges. much more realistic, MUCH more complex. orders of magnitude 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() {
render(){ color(color1) minkowski(){
color(color1) minkowski(){ // half minkowski in the z direction
// half minkowski. that means the shape is neither circumscribed nor inscribed. shape($minkowski_radius * 2, $minkowski_radius/2);
shape($minkowski_radius * 2, $minkowski_radius/2); difference(){
difference(){ sphere(r=$minkowski_radius, $fn=20);
sphere(r=$minkowski_radius, $fn=24); translate([0,0,-$minkowski_radius]){
translate([0,0,-$minkowski_radius]){ cube($minkowski_radius * 2, center=true);
cube($minkowski_radius * 2, center=true);
}
} }
} }
} }

View File

@ -6,3 +6,18 @@ include <key_profiles/oem.scad>
include <key_profiles/dsa.scad> include <key_profiles/dsa.scad>
include <key_profiles/sa.scad> include <key_profiles/sa.scad>
include <key_profiles/g20.scad> include <key_profiles/g20.scad>
// man, wouldn't it be so cool if functions were first order
module key_profile(key_profile_type, row) {
if (key_profile_type == "dcs") {
dcs_row(row) children();
} else if (key_profile_type == "oem") {
oem_row(row) children();
} else if (key_profile_type == "dsa") {
dsa_row(row) children();
} else if (key_profile_type == "sa") {
sa_row(row) children();
} else if (key_profile_type == "g20") {
g20_row(row) children();
}
}

View File

@ -4,7 +4,7 @@ module dsa_row(n=3) {
$width_difference = 6; // 5.7; $width_difference = 6; // 5.7;
$height_difference = 6; // 5.7; $height_difference = 6; // 5.7;
$total_depth = 8.1 + abs((n-3) * 1); $total_depth = 8.1 + abs((n-3) * 1);
$top_tilt = (n-3) * -7; $top_tilt = n == 5 ? -21 : (n-3) * 7;
$top_skew = 0; $top_skew = 0;
$dish_type = "spherical"; $dish_type = "spherical";
$dish_depth = 1.2; $dish_depth = 1.2;

View File

@ -3,9 +3,9 @@ module g20_row(n=3) {
$bottom_key_height = 18.16; $bottom_key_height = 18.16;
$width_difference = 2; $width_difference = 2;
$height_difference = 2; $height_difference = 2;
$total_depth = 6; $total_depth = 6 + abs((n-3) * 0.5);
$top_tilt = 2.5; $top_tilt = 2.5;
$top_tilt = (n-3) * -7 + 2.5; $top_tilt = n == 5 ? -18.5 : (n-3) * 7 + 2.5;
$top_skew = 0.75; $top_skew = 0.75;
$dish_type = "no dish"; $dish_type = "no dish";
$dish_depth = 0; $dish_depth = 0;
@ -13,7 +13,7 @@ module g20_row(n=3) {
$dish_skew_y = 0; $dish_skew_y = 0;
$minkowski_radius = 1.75; $minkowski_radius = 1.75;
//also, //also,
/*$rounded_key = true;*/ $rounded_key = true;
children(); children();

View File

@ -13,8 +13,9 @@ module sa_row(n=1) {
// might wanna change this if you don't minkowski // might wanna change this if you don't minkowski
// do you even minkowski bro // do you even minkowski bro
$corner_radius = 0.25; $corner_radius = 0.25;
// 5th row is usually unsculpted or the same as the row below it
if (n == 1){ // making a super-sculpted top row (or bottom row!) would be real easy
if (n == 1 || n == 5){
$total_depth = 14.89; $total_depth = 14.89;
$top_tilt = -13; $top_tilt = -13;
children(); children();
@ -22,7 +23,7 @@ module sa_row(n=1) {
$total_depth = 12.925; $total_depth = 12.925;
$top_tilt = -7; $top_tilt = -7;
children(); children();
} else if (n == 3) { } else if (n == 3 || n == 5) {
$total_depth = 12.5; $total_depth = 12.5;
$top_tilt = 0; $top_tilt = 0;
children(); children();