Fixed brimmed(); brim_height was not specified it is now globally declared in settings.scad

Added height to brimmed() which allows easily configuring the height of the brim.
This commit is contained in:
Myles Metzler 2018-02-24 22:02:46 -05:00
parent 32b6451a7f
commit d7311d2dac
5 changed files with 12 additions and 7 deletions

View File

@ -7,8 +7,9 @@ module translate_u(x=0, y=0, z=0){
translate([x * unit, y*unit, z*unit]) children();
}
module brimmed() {
module brimmed(height = 0.2) {
$has_brim = true;
$brim_height = height;
children();
}

View File

@ -41,6 +41,8 @@ $key_length = 1;
$key_height = 1;
//print brim for connector to help with bed adhesion
$has_brim = false;
//when $has_brim this is the height of the brim
$brim_height = 0.2;
// invert dishing. mostly for spacebar
$inverted_dish = false;
// array of positions of all stems. includes stabilizers as well, for now

View File

@ -1,10 +1,12 @@
module alps_stem(depth, has_brim){
if(has_brim) {
linear_extrude(h=brim_height) {
square($alps_stem * [2,2], center = true);
linear_extrude(height=$brim_height) {
offset(r=1){
square($alps_stem + [2,2], center=true);
}
}
}
linear_extrude(h=depth) {
linear_extrude(height=depth) {
square($alps_stem, center = true);
}
}

View File

@ -10,9 +10,9 @@ module cherry_stem(depth, has_brim) {
// brim, if applicable
if(has_brim) {
linear_extrude(height = brim_height){
linear_extrude(height = $brim_height){
offset(r=1){
square($cherry_stem - [2,2], center=true);
square($cherry_stem + [2,2], center=true);
}
}
}

View File

@ -3,7 +3,7 @@ module rounded_cherry_stem(depth, has_brim) {
union(){
cylinder(d=$rounded_cherry_stem_d, h=depth);
if(has_brim) {
cylinder(d=$rounded_cherry_stem_d * 2, h=brim_height);
cylinder(d=$rounded_cherry_stem_d * 2, h=$brim_height);
}
}