mirror of
https://github.com/rsheldiii/KeyV2.git
synced 2025-03-14 10:26:12 +00:00
Couple tweaks for doubleshot
This commit is contained in:
parent
e29bb46dfa
commit
24c80cb735
3 changed files with 36 additions and 22 deletions
|
@ -2846,7 +2846,7 @@ module keytext(text, position, font_size, depth) {
|
||||||
woffset = (top_total_key_width()/3.5) * position[0];
|
woffset = (top_total_key_width()/3.5) * position[0];
|
||||||
hoffset = (top_total_key_height()/3.5) * -position[1];
|
hoffset = (top_total_key_height()/3.5) * -position[1];
|
||||||
translate([woffset, hoffset, -depth]){
|
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");
|
text(text=text, font=$font, size=font_size, halign="center", valign="center");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4098,23 +4098,30 @@ module inside_features() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// helpers for doubleshot keycaps for now
|
||||||
|
module inner_total_shape() {
|
||||||
|
difference() {
|
||||||
|
inner_shape();
|
||||||
|
inside_features();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module outer_total_shape(inset=false) {
|
||||||
|
outer_shape();
|
||||||
|
additive_features(inset) {
|
||||||
|
children();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// The final, penultimate key generation function.
|
// The final, penultimate key generation function.
|
||||||
// takes all the bits and glues them together. requires configuration with special variables.
|
// takes all the bits and glues them together. requires configuration with special variables.
|
||||||
module key(inset=false) {
|
module key(inset=false) {
|
||||||
difference(){
|
difference(){
|
||||||
union() {
|
outer_total_shape(inset);
|
||||||
outer_shape();
|
|
||||||
additive_features(inset) {
|
|
||||||
children();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($inner_shape_type != "disable") {
|
if ($inner_shape_type != "disable") {
|
||||||
translate([0,0,-SMALLEST_POSSIBLE]) {
|
translate([0,0,-SMALLEST_POSSIBLE]) {
|
||||||
difference() {
|
inner_total_shape();
|
||||||
inner_shape();
|
|
||||||
inside_features();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ module keytext(text, position, font_size, depth) {
|
||||||
woffset = (top_total_key_width()/3.5) * position[0];
|
woffset = (top_total_key_width()/3.5) * position[0];
|
||||||
hoffset = (top_total_key_height()/3.5) * -position[1];
|
hoffset = (top_total_key_height()/3.5) * -position[1];
|
||||||
translate([woffset, hoffset, -depth]){
|
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");
|
text(text=text, font=$font, size=font_size, halign="center", valign="center");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
27
src/key.scad
27
src/key.scad
|
@ -201,23 +201,30 @@ module inside_features() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// helpers for doubleshot keycaps for now
|
||||||
|
module inner_total_shape() {
|
||||||
|
difference() {
|
||||||
|
inner_shape();
|
||||||
|
inside_features();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module outer_total_shape(inset=false) {
|
||||||
|
outer_shape();
|
||||||
|
additive_features(inset) {
|
||||||
|
children();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// The final, penultimate key generation function.
|
// The final, penultimate key generation function.
|
||||||
// takes all the bits and glues them together. requires configuration with special variables.
|
// takes all the bits and glues them together. requires configuration with special variables.
|
||||||
module key(inset=false) {
|
module key(inset=false) {
|
||||||
difference(){
|
difference(){
|
||||||
union() {
|
outer_total_shape(inset);
|
||||||
outer_shape();
|
|
||||||
additive_features(inset) {
|
|
||||||
children();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($inner_shape_type != "disable") {
|
if ($inner_shape_type != "disable") {
|
||||||
translate([0,0,-SMALLEST_POSSIBLE]) {
|
translate([0,0,-SMALLEST_POSSIBLE]) {
|
||||||
difference() {
|
inner_total_shape();
|
||||||
inner_shape();
|
|
||||||
inside_features();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue