move brim to stems.scad so cherry keys can cut out their cross. makes it way easier to print

This commit is contained in:
Bob - Home - Windows 2017-08-19 12:06:13 -04:00
parent 397c57ca97
commit 7e9e2f0e1e
5 changed files with 93420 additions and 142017 deletions

File diff suppressed because it is too large Load Diff

View File

@ -57,7 +57,10 @@ module spherical_dish(width, height, depth, inverted, tilt, txt=""){
/*}*/
}
module oldspherical_dish(width, height, depth, inverted, tilt, txt=""){
//the older, 'more accurate', and MUCH slower spherical dish.
/* I guess this stuff requires some explaining:
*/
module old_spherical_dish(width, height, depth, inverted, tilt, txt=""){
//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(width,2) + pow(height, 2)),0.5); //getting diagonal of the top

View File

@ -9,11 +9,6 @@ include <libraries/geodesic_sphere.scad>
keytop_thickness = 1;
// wall thickness, aka the thickness of the sides of the keycap. note this is the total thickness, aka 3 = 1.5mm walls
wall_thickness = 3;
/* [Brim] */
//brim radius. 11 ensconces normal keycap stem in normal keycap
brim_radius = 8;
//brim depth
brim_depth = .3;
//whether stabilizer connectors are enabled
stabilizers = false;
// font used for text
@ -251,8 +246,7 @@ module connectors($stem_profile) {
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);
connector($stem_profile, $has_brim);
}
}
}
@ -378,7 +372,7 @@ module fakeISOEnter(thickness_difference = 0){
];
offset(r=$corner_radius) {
polygon(points=pointArray);
polygon(points=pointArray, center=true);
}
}
@ -394,6 +388,7 @@ module ISOEnterShapeHull(thickness_difference, depth_difference, modifier){
linear_extrude(height = height, scale = [width_scale, height_scale]) {
// TODO completely making up these numbers here
translate([unit(-.5), unit(-.95)]) fakeISOEnter(thickness_difference);
// 0.86mm is from the unit function, 18.16 - 19.02. no idea what the 18 is, shows me for not leaving better comments
translate([unit(-.5), unit(-1) + 0.86]) fakeISOEnter(thickness_difference);
}
}

View File

@ -6,12 +6,13 @@
// special variables, but that's a limitation of SCAD we'll have to work around
/* TODO:
* Full experimental ISO enter
* fix stem inset
* can now measure keycaps very accurately. need to redo measurements: [x] SA [ ] DCS [ ] DSA [ ] OEM?
* Pregenerated keysets for DCS (rounded tops too intense) [ ] 60% [ ] TKL [ ] full
* make OEM profile from my WASD keyset
* Pregenerated keysets for DCS (rounded tops too intense) WITH rounded spacebar [ ] 60% [ ] TKL [ ] full
* Add inset stem to all profiles that need it (DCS?)
* generate dishes via math? kind of hard
* sideways cylindrical dish needs to be used for some spacebars but not others. currently none of them use it
* generate dishes via math? kind of hard
* customizer version where everything is copy/pasted in
*/
@ -88,7 +89,7 @@ module dsa_row(n=3) {
$bottom_key_height = 18.4;
$width_difference = 5.7;
$height_difference = 5.7;
$total_depth = 7.4;
$total_depth = 8;
$top_tilt = (n-1) * 7 - 14;
$top_skew = 0;
$dish_type = 1;
@ -366,19 +367,19 @@ module legend(text, inset=false) {
}
translate([0,0,0]){
for (x = [1:4]){
for (x = [0:4]){
translate_u(0,(x-1)){
sa_row(5-x) blank() key();
/*sa_row(5-x) blank() key();*/
translate_u(1) dcs_row(5-x) blank() key();
}
}
}
translate_u(2.1) {
brimmed() translate_u(2.1) {
translate_u(0, 1.5) fake_iso_enter() blank() key();
dsa_row() blank() key();
translate_u(0, 3) g20() blank() key();
translate_u(0, 1.5) fake_iso_enter() cherry() key();
dsa_row() alps() key();
translate_u(0, 3) g20() rounded_cherry() key();
}
/*
sa_row(1) blank() key();*/

View File

@ -1,39 +1,16 @@
// TODO uh what
cross_height = 25;
/* [Brim] */
//brim radius. 11 ensconces normal keycap stem in normal keycap
brim_radius = 6;
//brim depth
brim_depth = .3;
module cherry_stem() {
cherry_stem_base();
module brim(has_brim) {
if (has_brim) color([0,1,0]) cylinder(r=brim_radius,h=brim_depth);
}
module cherry_stem_rounded() {
// cross length
cross_length = 4.4;
//dimensions of connector
// outer cross extra length in x
extra_outer_cross_width = 2.10;
// outer cross extra length in y
extra_outer_cross_height = 1.0;
// dimensions of cross
// horizontal cross bar width
horizontal_cross_width = 1.4;
// vertical cross bar width
vertical_cross_width = 1.3;
// cross depth, stem height is 3.4mm
cross_depth = 4;
difference(){
cylinder(
d = cross_length+extra_outer_cross_height,
h = cross_height
);
//the cross part of the steam
translate([0,0,(cross_depth)/2 + stem_inset]){
cube([vertical_cross_width,cross_length,cross_depth], center=true );
cube([cross_length,horizontal_cross_width,cross_depth], center=true );
}
}
}
module cherry_stem_base(rounded = false){
module cherry_stem(has_brim) {
// cross length
cross_length = 4.4;
//extra vertical cross length - the extra length of the up/down bar of the cross
@ -52,11 +29,13 @@ module cherry_stem_base(rounded = false){
cross_depth = 4;
difference(){
translate([0,0,stem_inset]) {
brim(has_brim);
translate([
-(cross_length+extra_outer_cross_width)/2,
-(cross_length+extra_outer_cross_height)/2,
stem_inset
]) {
0
])
cube([ // the base of the stem, the part the cruciform digs into
cross_length+extra_outer_cross_width,
cross_length+extra_outer_cross_height,
@ -72,7 +51,39 @@ module cherry_stem_base(rounded = false){
}
}
module alps_stem(){
module cherry_stem_rounded(has_brim) {
// cross length
cross_length = 4.4;
//dimensions of connector
// outer cross extra length in x
extra_outer_cross_width = 2.10;
// outer cross extra length in y
extra_outer_cross_height = 1.0;
// dimensions of cross
// horizontal cross bar width
horizontal_cross_width = 1.4;
// vertical cross bar width
vertical_cross_width = 1.3;
// cross depth, stem height is 3.4mm
cross_depth = 4;
difference(){
union(){
cylinder(
d = cross_length+extra_outer_cross_height,
h = cross_height
);
brim(has_brim);
}
//the cross part of the steam
translate([0,0,(cross_depth)/2 + stem_inset]){
cube([vertical_cross_width,cross_length,cross_depth], center=true );
cube([cross_length,horizontal_cross_width,cross_depth], center=true );
}
}
}
module alps_stem(has_brim = false){
cross_depth = 40;
width = 4.45;
height = 2.25;
@ -80,6 +91,7 @@ module alps_stem(){
base_width = 12;
base_height = 15;
brim(has_brim);
translate([0,0,cross_depth/2 + stem_inset]){
cube([width,height,cross_depth], center = true);
}
@ -87,12 +99,12 @@ module alps_stem(){
//whole connector, alps or cherry, trimmed to fit
module connector(stem_profile){
module connector(stem_profile, has_brim){
if (stem_profile == "alps") {
alps_stem();
alps_stem(has_brim);
} else if (stem_profile == "cherry_rounded") {
cherry_stem_rounded();
cherry_stem_rounded(has_brim);
} else if (stem_profile == "cherry") {
cherry_stem();
cherry_stem(has_brim);
}
}