add customizer script, fix height bug

This commit is contained in:
Bob - Home - Windows 2018-02-06 01:26:19 -05:00
parent aa795c4958
commit 48883bd8b1
5 changed files with 1256 additions and 8 deletions

1233
customizer.scad Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,6 @@
// without having to rely on this file. Unfortunately that means setting tons of // 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 // special variables, but that's a limitation of SCAD we have to work around
//TODO duplicate def to not make this a special var. maybe not worth it
unit = 19.05;
use <src/key.scad> use <src/key.scad>
include <src/settings.scad> include <src/settings.scad>
@ -16,10 +13,6 @@ 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>
module translate_u(x=0, y=0, z=0){
translate([x * unit, y*unit, z*unit]) children();
}
// basic // basic
cherry() key(); cherry() key();

View File

@ -122,7 +122,7 @@ module inside() {
// put something at the top of the key, with no adjustments for dishing // put something at the top of the key, with no adjustments for dishing
module top_placement(depth_difference) { module top_placement(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]){
rotate([-$top_tilt,0,0]){ rotate([-$top_tilt / top_total_key_height(),0,0]){
children(); children();
} }
} }

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

@ -1,5 +1,12 @@
// kind of a catch-all at this point for any directive that doesn't fit in the other files // kind of a catch-all at this point for any directive that doesn't fit in the other files
//TODO duplicate def to not make this a special var. maybe not worth it
unit = 19.05;
module translate_u(x=0, y=0, z=0){
translate([x * unit, y*unit, z*unit]) children();
}
module brimmed() { module brimmed() {
$has_brim = true; $has_brim = true;
children(); children();