various small fixes while preparing for release

This commit is contained in:
Robert Sheldon 2018-07-26 01:48:15 -04:00
parent 3a34494959
commit 1149cade39
11 changed files with 85 additions and 25 deletions

View File

@ -32,8 +32,8 @@ $inverted_dish = false;
// Support type. default is "flared" for easy FDM printing; bars are more realistic, and flat could be for artisans // Support type. default is "flared" for easy FDM printing; bars are more realistic, and flat could be for artisans
$support_type = "flared"; // [flared, bars, flat, disable] $support_type = "flared"; // [flared, bars, flat, disable]
// Supports for the stem, as it often comes off during printing. disabled by default, but highly reccommended. // Supports for the stem, as it often comes off during printing. Reccommended for most machines
$stem_support_type = "disable"; // [tines, brim, disabled] $stem_support_type = "tines"; // [tines, brim, disabled]
/* [Advanced] */ /* [Advanced] */
@ -224,7 +224,7 @@ module 6_25uh() {
// unlike the other files with their own dedicated folders, this one doesn't // unlike the other files with their own dedicated folders, this one doesn't
// need a selector. I wrote one anyways for customizer support though // need a selector. I wrote one anyways for customizer support though
module dcs_row(n=1) { module dcs_row(n=3) {
// 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;
@ -260,7 +260,7 @@ module dcs_row(n=1) {
children(); children();
} }
} }
module oem_row(n=1) { module oem_row(n=3) {
$bottom_key_width = 18.05; $bottom_key_width = 18.05;
$bottom_key_height = 18.05; $bottom_key_height = 18.05;
$width_difference = 5.8; $width_difference = 5.8;
@ -334,7 +334,7 @@ module dsa_row(n=3) {
children(); children();
} }
} }
module sa_row(n=1) { module sa_row(n=3) {
$key_shape_type = "sculpted_square"; $key_shape_type = "sculpted_square";
$bottom_key_width = 18.4; $bottom_key_width = 18.4;
$bottom_key_height = 18.4; $bottom_key_height = 18.4;
@ -381,7 +381,8 @@ module g20_row(n=3) {
$top_tilt = 2.5; $top_tilt = 2.5;
$top_skew = 0.75; $top_skew = 0.75;
$dish_type = "disable"; $dish_type = "disable";
$dish_depth = 0; // something weird is going on with this and legends - can't put it below 1.2 or they won't show
$dish_depth = 1.2;
$dish_skew_x = 0; $dish_skew_x = 0;
$dish_skew_y = 0; $dish_skew_y = 0;
$minkowski_radius = 1.75; $minkowski_radius = 1.75;
@ -616,11 +617,35 @@ module bump(depth=undef) {
$key_bump_depth = depth == undef ? $key_bump_depth : depth; $key_bump_depth = depth == undef ? $key_bump_depth : depth;
children(); children();
} }
module arrows(profile, rows = [4,4,4,3]) {
positions = [[0, 0], [1, 0], [2, 0], [1, 1]];
legends = ["←", "↓", "→", "↑"];
for (i = [0:3]) {
translate_u(positions[i].x, positions[i].y) key_profile(profile, rows[i]) legend(legends[i]) cherry() key(true);
}
}
module f_cluster(profile, row=5) {
legends = ["F1", "F2", "F3", "F4"];
for (i =[0:len(legends)-1]) {
translate_u(i) key_profile(profile, row) cherry() legend(legends[i]) key(true);
}
}
module wasd(profile, rows = [2,2,2,1]) {
positions = [[0, 0], [1, 0], [2, 0], [1, 1]];
legends = ["A", "S", "D", "W"];
for (i = [0:3]) {
translate_u(positions[i].x, positions[i].y) key_profile(profile, rows[i]) legend(legends[i]) cherry() key(true);
}
}
module row_profile(profile, unsculpted = false) { module row_profile(profile, unsculpted = false) {
rows = [5, 1, 2, 3, 4]; rows = [5, 1, 2, 3, 4];
for(row = [0:len(rows)-1]) { for(row = [0:len(rows)-1]) {
translate_u(0, -row) key_profile(profile, unsculpted ? 3 : rows[row]); translate_u(0, -row) key_profile(profile, unsculpted ? 3 : rows[row]) children();
} }
} }
@ -739,10 +764,12 @@ module side_rounded_square(size, r) {
sh = ih / resolution; sh = ih / resolution;
sw = iw / resolution; sw = iw / resolution;
union() { union() {
if (sr > 0) {
translate([-iw/2, 0]) scale([sr, sh]) circle(d = resolution); translate([-iw/2, 0]) scale([sr, sh]) circle(d = resolution);
translate([iw/2, 0]) scale([sr, sh]) circle(d = resolution); translate([iw/2, 0]) scale([sr, sh]) circle(d = resolution);
translate([0, -ih/2]) scale([sw, sr]) circle(d = resolution); translate([0, -ih/2]) scale([sw, sr]) circle(d = resolution);
translate([0, ih/2]) scale([sw, sr]) circle(d = resolution); translate([0, ih/2]) scale([sw, sr]) circle(d = resolution);
}
square([iw, ih], center=true); square([iw, ih], center=true);
} }
} }
@ -1306,7 +1333,7 @@ module tines_support(stem_type, stem_support_height, slop) {
if (stem_type == "cherry") { if (stem_type == "cherry") {
difference () { difference () {
union() { union() {
translate([0,0,$stem_support_height / 2]) cube([total_key_width($wall_thickness), 1, $stem_support_height], center = true); if ($key_length < 2) translate([0,0,$stem_support_height / 2]) cube([total_key_width($wall_thickness), 1, $stem_support_height], center = true);
translate([2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true); translate([2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true);
translate([-2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true); translate([-2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true);
} }
@ -1995,8 +2022,10 @@ module clearance_check() {
module artisan(depth) { module artisan(depth) {
top_of_key() { top_of_key() {
// outset legend // outset legend
for (i=[0:len($legends)-1]) { if (len($legends) > 0) {
for (i=[0:len($legends)-1]) {
keytext($legends[i][0], $legends[i][1], $legends[i][2], depth); keytext($legends[i][0], $legends[i][1], $legends[i][2], depth);
}
} }
// artisan objects / outset shape legends // artisan objects / outset shape legends
children(); children();
@ -2088,8 +2117,8 @@ $inverted_dish = false;
// Support type. default is "flared" for easy FDM printing; bars are more realistic, and flat could be for artisans // Support type. default is "flared" for easy FDM printing; bars are more realistic, and flat could be for artisans
$support_type = "flared"; // [flared, bars, flat, disable] $support_type = "flared"; // [flared, bars, flat, disable]
// Supports for the stem, as it often comes off during printing. disabled by default, but highly reccommended. // Supports for the stem, as it often comes off during printing. Reccommended for most machines
$stem_support_type = "disable"; // [tines, brim, disabled] $stem_support_type = "tines"; // [tines, brim, disabled]
/* [Advanced] */ /* [Advanced] */

View File

@ -17,6 +17,7 @@ include <src/key_sizes.scad>
include <src/key_profiles.scad> include <src/key_profiles.scad>
include <src/key_types.scad> include <src/key_types.scad>
include <src/key_transformations.scad> include <src/key_transformations.scad>
include <src/key_helpers.scad>
use <src/key.scad> use <src/key.scad>

View File

@ -12,5 +12,6 @@ include <src/key_sizes.scad>
include <src/key_profiles.scad> include <src/key_profiles.scad>
include <src/key_types.scad> include <src/key_types.scad>
include <src/key_transformations.scad> include <src/key_transformations.scad>
include <src/key_helpers.scad>
key(); key();

View File

@ -1,8 +1,8 @@
require './openscad.rb' require './openscad.rb'
require 'tempfile' require 'tempfile'
ROWS = [5,1,2,3,4].freeze ROWS = [5,1,2,3,4].freeze # [5,1,2,3,4]
SIZES = [1].freeze # , 1.25, 1.5, 1.75, 2, 2.25, 2.75, 6.25 SIZES = [1, 1.25, 1.5, 1.75, 2, 2.25, 2.75, 6.25].freeze
PROFILES = ['dcs', 'dsa', 'g20', 'oem', 'sa'].freeze PROFILES = ['dcs', 'dsa', 'g20', 'oem', 'sa'].freeze
# can't get include statements to work dynamically so we'll just use a file # can't get include statements to work dynamically so we'll just use a file

View File

@ -238,8 +238,10 @@ module clearance_check() {
module artisan(depth) { module artisan(depth) {
top_of_key() { top_of_key() {
// outset legend // outset legend
for (i=[0:len($legends)-1]) { if (len($legends) > 0) {
for (i=[0:len($legends)-1]) {
keytext($legends[i][0], $legends[i][1], $legends[i][2], depth); keytext($legends[i][0], $legends[i][1], $legends[i][2], depth);
}
} }
// artisan objects / outset shape legends // artisan objects / outset shape legends
children(); children();

31
src/key_helpers.scad Normal file
View File

@ -0,0 +1,31 @@
module arrows(profile, rows = [4,4,4,3]) {
positions = [[0, 0], [1, 0], [2, 0], [1, 1]];
legends = ["←", "↓", "→", "↑"];
for (i = [0:3]) {
translate_u(positions[i].x, positions[i].y) key_profile(profile, rows[i]) legend(legends[i]) cherry() key(true);
}
}
module f_cluster(profile, row=5) {
legends = ["F1", "F2", "F3", "F4"];
for (i =[0:len(legends)-1]) {
translate_u(i) key_profile(profile, row) cherry() legend(legends[i]) key(true);
}
}
module wasd(profile, rows = [2,2,2,1]) {
positions = [[0, 0], [1, 0], [2, 0], [1, 1]];
legends = ["A", "S", "D", "W"];
for (i = [0:3]) {
translate_u(positions[i].x, positions[i].y) key_profile(profile, rows[i]) legend(legends[i]) cherry() key(true);
}
}
module row_profile(profile, unsculpted = false) {
rows = [5, 1, 2, 3, 4];
for(row = [0:len(rows)-1]) {
translate_u(0, -row) key_profile(profile, unsculpted ? 3 : rows[row]) children();
}
}

View File

@ -6,7 +6,8 @@ module g20_row(n=3) {
$top_tilt = 2.5; $top_tilt = 2.5;
$top_skew = 0.75; $top_skew = 0.75;
$dish_type = "disable"; $dish_type = "disable";
$dish_depth = 0; // something weird is going on with this and legends - can't put it below 1.2 or they won't show
$dish_depth = 1.2;
$dish_skew_x = 0; $dish_skew_x = 0;
$dish_skew_y = 0; $dish_skew_y = 0;
$minkowski_radius = 1.75; $minkowski_radius = 1.75;

View File

@ -124,10 +124,3 @@ module bump(depth=undef) {
$key_bump_depth = depth == undef ? $key_bump_depth : depth; $key_bump_depth = depth == undef ? $key_bump_depth : depth;
children(); children();
} }
module row_profile(profile, unsculpted = false) {
rows = [5, 1, 2, 3, 4];
for(row = [0:len(rows)-1]) {
translate_u(0, -row) key_profile(profile, unsculpted ? 3 : rows[row]) children();
}
}

View File

@ -19,8 +19,8 @@ $inverted_dish = false;
// Support type. default is "flared" for easy FDM printing; bars are more realistic, and flat could be for artisans // Support type. default is "flared" for easy FDM printing; bars are more realistic, and flat could be for artisans
$support_type = "flared"; // [flared, bars, flat, disable] $support_type = "flared"; // [flared, bars, flat, disable]
// Supports for the stem, as it often comes off during printing. disabled by default, but highly reccommended. // Supports for the stem, as it often comes off during printing. Reccommended for most machines
$stem_support_type = "disable"; // [tines, brim, disabled] $stem_support_type = "tines"; // [tines, brim, disabled]
/* [Advanced] */ /* [Advanced] */

View File

@ -50,10 +50,12 @@ module side_rounded_square(size, r) {
sh = ih / resolution; sh = ih / resolution;
sw = iw / resolution; sw = iw / resolution;
union() { union() {
if (sr > 0) {
translate([-iw/2, 0]) scale([sr, sh]) circle(d = resolution); translate([-iw/2, 0]) scale([sr, sh]) circle(d = resolution);
translate([iw/2, 0]) scale([sr, sh]) circle(d = resolution); translate([iw/2, 0]) scale([sr, sh]) circle(d = resolution);
translate([0, -ih/2]) scale([sw, sr]) circle(d = resolution); translate([0, -ih/2]) scale([sw, sr]) circle(d = resolution);
translate([0, ih/2]) scale([sw, sr]) circle(d = resolution); translate([0, ih/2]) scale([sw, sr]) circle(d = resolution);
}
square([iw, ih], center=true); square([iw, ih], center=true);
} }
} }

View File

@ -10,7 +10,7 @@ module tines_support(stem_type, stem_support_height, slop) {
if (stem_type == "cherry") { if (stem_type == "cherry") {
difference () { difference () {
union() { union() {
translate([0,0,$stem_support_height / 2]) cube([total_key_width($wall_thickness), 1, $stem_support_height], center = true); if ($key_length < 2) translate([0,0,$stem_support_height / 2]) cube([total_key_width($wall_thickness), 1, $stem_support_height], center = true);
translate([2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true); translate([2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true);
translate([-2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true); translate([-2,0,$stem_support_height / 2]) cube([1, total_key_height($wall_thickness), $stem_support_height], center = true);
} }