Couple tweaks for doubleshot

This commit is contained in:
Bob 2020-07-08 13:58:05 -04:00
parent e29bb46dfa
commit 24c80cb735
3 changed files with 36 additions and 22 deletions

View File

@ -2846,7 +2846,7 @@ module keytext(text, position, font_size, depth) {
woffset = (top_total_key_width()/3.5) * position[0];
hoffset = (top_total_key_height()/3.5) * -position[1];
translate([woffset, hoffset, -depth]){
color($tertiary_color) linear_extrude(height=$dish_depth){
color($tertiary_color) linear_extrude(height=$dish_depth + depth){
text(text=text, font=$font, size=font_size, halign="center", valign="center");
}
}
@ -4098,23 +4098,30 @@ module inside_features() {
}
}
// The final, penultimate key generation function.
// takes all the bits and glues them together. requires configuration with special variables.
module key(inset=false) {
// helpers for doubleshot keycaps for now
module inner_total_shape() {
difference() {
union() {
inner_shape();
inside_features();
}
}
module outer_total_shape(inset=false) {
outer_shape();
additive_features(inset) {
children();
};
}
// The final, penultimate key generation function.
// takes all the bits and glues them together. requires configuration with special variables.
module key(inset=false) {
difference(){
outer_total_shape(inset);
if ($inner_shape_type != "disable") {
translate([0,0,-SMALLEST_POSSIBLE]) {
difference() {
inner_shape();
inside_features();
}
inner_total_shape();
}
}

View File

@ -2,7 +2,7 @@ module keytext(text, position, font_size, depth) {
woffset = (top_total_key_width()/3.5) * position[0];
hoffset = (top_total_key_height()/3.5) * -position[1];
translate([woffset, hoffset, -depth]){
color($tertiary_color) linear_extrude(height=$dish_depth){
color($tertiary_color) linear_extrude(height=$dish_depth + depth){
text(text=text, font=$font, size=font_size, halign="center", valign="center");
}
}

View File

@ -201,23 +201,30 @@ module inside_features() {
}
}
// The final, penultimate key generation function.
// takes all the bits and glues them together. requires configuration with special variables.
module key(inset=false) {
// helpers for doubleshot keycaps for now
module inner_total_shape() {
difference() {
union() {
inner_shape();
inside_features();
}
}
module outer_total_shape(inset=false) {
outer_shape();
additive_features(inset) {
children();
};
}
// The final, penultimate key generation function.
// takes all the bits and glues them together. requires configuration with special variables.
module key(inset=false) {
difference(){
outer_total_shape(inset);
if ($inner_shape_type != "disable") {
translate([0,0,-SMALLEST_POSSIBLE]) {
difference() {
inner_shape();
inside_features();
}
inner_total_shape();
}
}