tines.scad
1 include <../functions.scad> 2 include <../stems/cherry.scad> 3 4 module centered_tines(stem_support_height) { 5 if ($key_length < 2) { 6 translate([0,0,$stem_support_height / 2]) { 7 cube([total_key_width(), 0.5, $stem_support_height], center = true); 8 } 9 } 10 11 translate([0,0,$stem_support_height / 2]) { 12 cube([ 13 1, 14 total_key_height(), 15 $stem_support_height 16 ], 17 center = true); 18 } 19 } 20 21 module tines_support(stem_type, stem_support_height, slop) { 22 extra_height = $extra_long_stem_support ? ($unit - total_key_height()) + 0.1 : -$wall_thickness/4; // fudge 23 extra_width = $extra_long_stem_support ? ($unit - total_key_width()) + 0.1 : -$wall_thickness/4; 24 25 if (stem_type == "cherry" || stem_type == "costar_stabilizer") { 26 difference () { 27 union() { 28 if ($key_length < 2) { 29 translate([0,0,$stem_support_height / 2]) { 30 cube([ 31 total_key_width() + extra_width*2, 32 0.5, 33 $stem_support_height 34 ], center = true); 35 } 36 } 37 38 // 2 vertical tines holding either side of the cruciform 39 for (x = [1.15, -1.15]) { 40 translate([x,0,$stem_support_height / 2]) { 41 cube([ 42 0.5, 43 total_key_height() + extra_height*2, // this is to extend past 44 $stem_support_height 45 ], center = true); 46 } 47 } 48 } 49 50 inside_cherry_cross(slop); 51 } 52 } else if (stem_type == "cherry_stabilizer") { 53 difference () { 54 for (x = [1.15, -1.15]) { 55 translate([x,0,$stem_support_height / 2]) { 56 cube([ 57 1, 58 total_key_height($wall_thickness), 59 $stem_support_height 60 ], center = true); 61 } 62 } 63 64 inside_cherry_stabilizer_cross(slop); 65 } 66 } else if (stem_type == "box_cherry") { 67 difference () { 68 centered_tines(stem_support_height); 69 70 inside_cherry_cross(slop); 71 } 72 } else if (stem_type == "rounded_cherry") { 73 difference () { 74 centered_tines(stem_support_height); 75 76 inside_cherry_cross(slop); 77 } 78 } else if (stem_type == "alps"){ 79 centered_tines(stem_support_height); 80 } 81 }