1+ include < ../../variables.scad>
2+ use < ../../lib/utils.scad>
3+
4+
15$ fn = $ preview ? 20 : 60 ;
26z = [0 , 0 , 1 ];
37y = [0 , 1 , 0 ];
@@ -12,6 +16,7 @@ z2 = -cz * 1.5;
1216sizet = [cxy + 2 , cxy + 2 , 4 ];
1317sizef = [cxy + 5 , cxy + 5 , h];
1418z4 = - sizef[2 ] / 2 ;
19+ SMALLEST_POSSIBLE = 0.01 ;
1520
1621if ($ preview) import("/home/paulg/Downloads/kailh_low.stl" );
1722module hole() {
@@ -32,22 +37,27 @@ module cable() {
3237 }
3338}
3439
35- difference () {
36- union () {
37- translate (z4 * z)cube (sizef, center = true );
38- translate (- 4 * z)cube ([7 , cxy + 16 , 8 ], center = true );
39- }
40+ module button(detail = true) {
41+ difference () {
42+ union () {
43+ translate (z4 * z)cube (sizef, center = true );
44+ translate (- 4 * z)cube ([7 , cxy + 16 , 8 ], center = true );
45+ }
4046
41- hole();
42- #for (i = [- 1 , 1 ]) translate ((cxy + 8 ) / 2 * y * i) rubber_ring();
43- handlebar();
44- cable();
45- }
46- difference () {
47- translate (- 0.1 * z)cube ([7 , cxy + 16 , 0.2 ], center = true );
48- hole();
47+ if (detail) {
48+ hole();
49+ for (i = [- 1 , 1 ]) translate ((cxy + 8 ) / 2 * y * i) rubber_ring();
50+ handlebar();
51+ cable();
52+ }
53+ }
54+ difference () {
55+ translate (- 0.1 * z)cube ([7 , cxy + 16 , 0.2 ], center = true );
56+ hole();
57+ }
4958}
5059
60+ button();
5161
5262module rubber_ring() {
5363 translate (- 18.5 * z)
@@ -90,4 +100,33 @@ module bottom(width = cxy, diam = 5) {
90100 }
91101}
92102
93- translate (y * 25 ) bottom();
103+ translate (y * 25 ) bottom();
104+ module buttoncutter(spacing = .5) {
105+ translate (- (spacing + 3.5 ) * z)minkowski () {
106+ cube (spacing,center= true );
107+ union () {button(detail = false );
108+ hull () {
109+ linear_extrude(1 )translate ((- cxy / 2 - 1 ) * (x + y))square([cxy + 2 , cxy + 2 ]);
110+ translate (z * 2.5 )linear_extrude(1 )translate ((- cxy / 2 ) * (x + y))square([cxy, cxy]);
111+ }
112+ }
113+ }
114+ }
115+
116+
117+ module buttontop(wall=3) {
118+ translate (- 6 * z)rounded_cherry_stem(6 , 5 , 4 );
119+ translate (- 6 * z)rounded_cherry_stem(6 , 5 , 4 );
120+ difference () {
121+ hull () {
122+ translate (- z)linear_extrude(1 )translate ((- cxy / 2 - 1 ) * (x + y))square([cxy + 2 , cxy + 2 ]);
123+ translate (- 5 * z)linear_extrude(1 )translate ((- (cxy+ 5 + wall )/ 2 ) * (x + y))square([cxy + 5 + wall, cxy + 5 + wall]);
124+ translate (- 8 * z)linear_extrude(1 )translate ((- (cxy+ 5 + wall )/ 2 ) * (x + y))square([cxy + 5 + wall, cxy + 5 + wall]);
125+
126+ }
127+ translate (- z)buttoncutter();
128+
129+ }
130+ }
131+
132+ translate (- 30 * y)buttontop();
0 commit comments