fix slop
This commit is contained in:
parent
e6b8943cfb
commit
3c59a15160
|
@ -185,7 +185,7 @@ module keystem_positions() {
|
||||||
|
|
||||||
module keystems() {
|
module keystems() {
|
||||||
keystem_positions() {
|
keystem_positions() {
|
||||||
color(color4) stem($stem_type, $total_depth, $has_brim);
|
color(color4) stem($stem_type, $total_depth, $has_brim, $stem_slop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,20 +68,20 @@ module blank() {
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module cherry(slop = 0.3) {
|
module cherry(slop) {
|
||||||
$stem_slop = slop;
|
$stem_slop = slop ? slop : $stem_slop;
|
||||||
$stem_type = "cherry";
|
$stem_type = "cherry";
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module alps(slop = 0.3) {
|
module alps(slop) {
|
||||||
$stem_slop = slop;
|
$stem_slop = slop ? slop : $stem_slop;
|
||||||
$stem_type = "alps";
|
$stem_type = "alps";
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
||||||
module rounded_cherry(slop = 0.3) {
|
module rounded_cherry(slop) {
|
||||||
$stem_slop = slop;
|
$stem_slop = slop ? slop : $stem_slop;
|
||||||
$stem_type = "cherry_rounded";
|
$stem_type = "cherry_rounded";
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,17 +91,6 @@ $brim_height = 0.4;
|
||||||
// how far the throw distance of the switch is. determines how far the 'cross' in the cherry switch digs into the stem, and how long the keystem needs to be before supports can start. luckily, alps and cherries have a pretty similar throw. can modify to have stouter keycaps for low profile switches, etc
|
// how far the throw distance of the switch is. determines how far the 'cross' in the cherry switch digs into the stem, and how long the keystem needs to be before supports can start. luckily, alps and cherries have a pretty similar throw. can modify to have stouter keycaps for low profile switches, etc
|
||||||
$stem_throw = 4;
|
$stem_throw = 4;
|
||||||
|
|
||||||
// cherry stem dimensions
|
|
||||||
$cherry_stem = [7.2 - $stem_slop * 2, 5.5 - $stem_slop * 2];
|
|
||||||
|
|
||||||
// .005 purely for aesthetics, to get rid of that ugly crosshatch
|
|
||||||
$cherry_cross = [
|
|
||||||
// horizontal tine
|
|
||||||
[4.03 + $stem_slop, 1.15 + $stem_slop / 3],
|
|
||||||
// vertical tine
|
|
||||||
[1.25 + $stem_slop / 3, $cherry_stem[1] + .005],
|
|
||||||
];
|
|
||||||
|
|
||||||
// diameter of the outside of the rounded cherry stem
|
// diameter of the outside of the rounded cherry stem
|
||||||
$rounded_cherry_stem_d = 5.5;
|
$rounded_cherry_stem_d = 5.5;
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,13 @@ include <stems/filled.scad>
|
||||||
|
|
||||||
|
|
||||||
//whole stem, alps or cherry, trimmed to fit
|
//whole stem, alps or cherry, trimmed to fit
|
||||||
module stem(stem_type, depth, has_brim){
|
module stem(stem_type, depth, has_brim, slop){
|
||||||
if (stem_type == "alps") {
|
if (stem_type == "alps") {
|
||||||
alps_stem(depth, has_brim);
|
alps_stem(depth, has_brim, slop);
|
||||||
} else if (stem_type == "cherry_rounded") {
|
} else if (stem_type == "cherry_rounded") {
|
||||||
rounded_cherry_stem(depth, has_brim);
|
rounded_cherry_stem(depth, has_brim, slop);
|
||||||
} else if (stem_type == "cherry") {
|
} else if (stem_type == "cherry") {
|
||||||
cherry_stem(depth, has_brim);
|
cherry_stem(depth, has_brim, slop);
|
||||||
} else if (stem_type == "filled") {
|
} else if (stem_type == "filled") {
|
||||||
filled_stem();
|
filled_stem();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module alps_stem(depth, has_brim){
|
module alps_stem(depth, has_brim, slop){
|
||||||
if(has_brim) {
|
if(has_brim) {
|
||||||
linear_extrude(height=$brim_height) {
|
linear_extrude(height=$brim_height) {
|
||||||
offset(r=1){
|
offset(r=1){
|
||||||
|
|
|
@ -1,10 +1,21 @@
|
||||||
module cherry_stem(depth, has_brim) {
|
// cherry stem dimensions
|
||||||
|
function outer_cherry_stem(slop) = [7.2 - slop * 2, 5.5 - slop * 2];
|
||||||
|
|
||||||
|
// .005 purely for aesthetics, to get rid of that ugly crosshatch
|
||||||
|
function cherry_cross(slop) = [
|
||||||
|
// horizontal tine
|
||||||
|
[4.03 + slop, 1.15 + slop / 3],
|
||||||
|
// vertical tine
|
||||||
|
[1.25 + slop / 3, 5.5 - slop * 2 + .005],
|
||||||
|
];
|
||||||
|
|
||||||
|
module cherry_stem(depth, has_brim, slop) {
|
||||||
difference(){
|
difference(){
|
||||||
union() {
|
union() {
|
||||||
// outside shape
|
// outside shape
|
||||||
linear_extrude(height = depth) {
|
linear_extrude(height = depth) {
|
||||||
offset(r=1){
|
offset(r=1){
|
||||||
square($cherry_stem - [2,2], center=true);
|
square(outer_cherry_stem(slop) - [2,2], center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +23,7 @@ module cherry_stem(depth, has_brim) {
|
||||||
if(has_brim) {
|
if(has_brim) {
|
||||||
linear_extrude(height = $brim_height){
|
linear_extrude(height = $brim_height){
|
||||||
offset(r=1){
|
offset(r=1){
|
||||||
square($cherry_stem + [2,2], center=true);
|
square(outer_cherry_stem(slop) + [2,2], center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,11 +33,11 @@ module cherry_stem(depth, has_brim) {
|
||||||
// translation purely for aesthetic purposes, to get rid of that awful lattice
|
// translation purely for aesthetic purposes, to get rid of that awful lattice
|
||||||
translate([0,0,-0.005]) {
|
translate([0,0,-0.005]) {
|
||||||
linear_extrude(height = $stem_throw) {
|
linear_extrude(height = $stem_throw) {
|
||||||
square($cherry_cross[0], center=true);
|
square(cherry_cross(slop)[0], center=true);
|
||||||
square($cherry_cross[1], center=true);
|
square(cherry_cross(slop)[1], center=true);
|
||||||
}
|
}
|
||||||
// Guides to assist insertion and mitigate first layer squishing
|
// Guides to assist insertion and mitigate first layer squishing
|
||||||
for (i = $cherry_cross) hull() {
|
for (i = cherry_cross(slop)) hull() {
|
||||||
linear_extrude(height = 0.01, center = false) offset(delta = 0.4) square(i, center=true);
|
linear_extrude(height = 0.01, center = false) offset(delta = 0.4) square(i, center=true);
|
||||||
translate([0, 0, 0.5]) linear_extrude(height = 0.01, center = false) square(i, center=true);
|
translate([0, 0, 0.5]) linear_extrude(height = 0.01, center = false) square(i, center=true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
module rounded_cherry_stem(depth, has_brim) {
|
// .005 purely for aesthetics, to get rid of that ugly crosshatch
|
||||||
|
function cherry_cross(slop) = [
|
||||||
|
// horizontal tine
|
||||||
|
[4.03 + slop, 1.15 + slop / 3],
|
||||||
|
// vertical tine
|
||||||
|
[1.25 + slop / 3, 5.5 - slop * 2 + .005],
|
||||||
|
];
|
||||||
|
|
||||||
|
module rounded_cherry_stem(depth, has_brim, slop) {
|
||||||
difference(){
|
difference(){
|
||||||
union(){
|
union(){
|
||||||
cylinder(d=$rounded_cherry_stem_d, h=depth);
|
cylinder(d=$rounded_cherry_stem_d, h=depth);
|
||||||
|
@ -11,8 +19,8 @@ module rounded_cherry_stem(depth, has_brim) {
|
||||||
// translation purely for aesthetic purposes, to get rid of that awful lattice
|
// translation purely for aesthetic purposes, to get rid of that awful lattice
|
||||||
translate([0,0,-0.005]) {
|
translate([0,0,-0.005]) {
|
||||||
linear_extrude(height = $stem_throw) {
|
linear_extrude(height = $stem_throw) {
|
||||||
square($cherry_cross[0], center=true);
|
square(cherry_cross(slop)[0], center=true);
|
||||||
square($cherry_cross[1], center=true);
|
square(cherry_cross(slop)[1], center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
// cherry stem dimensions
|
||||||
|
// don't wanna introduce slop here so $stem_slop it is I guess
|
||||||
|
function outer_cherry_stem() = [7.2 - $stem_slop * 2, 5.5 - $stem_slop * 2];
|
||||||
|
|
||||||
// figures out the scale factor needed to make a 45 degree wall
|
// figures out the scale factor needed to make a 45 degree wall
|
||||||
function scale_for_45(height, starting_size) = (height * 2 + starting_size) / starting_size;
|
function scale_for_45(height, starting_size) = (height * 2 + starting_size) / starting_size;
|
||||||
|
|
||||||
|
@ -6,10 +10,10 @@ function scale_for_45(height, starting_size) = (height * 2 + starting_size) / st
|
||||||
module flared_support(stem_type, loft, height) {
|
module flared_support(stem_type, loft, height) {
|
||||||
translate([0,0,loft]){
|
translate([0,0,loft]){
|
||||||
if(stem_type == "cherry") {
|
if(stem_type == "cherry") {
|
||||||
cherry_scale = [scale_for_45(height, $cherry_stem[0]), scale_for_45(height, $cherry_stem[1])];
|
cherry_scale = [scale_for_45(height, outer_cherry_stem()[0]), scale_for_45(height, outer_cherry_stem()[1])];
|
||||||
linear_extrude(height=height, scale = cherry_scale){
|
linear_extrude(height=height, scale = cherry_scale){
|
||||||
offset(r=1){
|
offset(r=1){
|
||||||
square($cherry_stem - [2,2], center=true);
|
square(outer_cherry_stem() - [2,2], center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (stem_type == "cherry_rounded") {
|
} else if (stem_type == "cherry_rounded") {
|
||||||
|
|
Loading…
Reference in New Issue