1- $ fn= 150 ;
2- z= [0 ,0 ,1 ];
3- y= [0 ,1 ,0 ];
4- cz= 1.2 ;
5- h= 15 ;
6- cxy= 13.7 ;
7- size= [cxy,cxy,h];
8- z1=- h/2 ;
9- sizeb= [cxy+ 1 ,cxy,cz];
10- z2=- cz* 1.5 ;
11- sizet= [cxy+ 2 ,cxy+ 2 ,4 ];
12- sizef= [cxy+ 5 ,cxy+ 5 ,h];
13- z4=- sizef[2 ]/2 ;
1+ $ fn = $ preview ? 20 : 60 ;
2+ z = [0 , 0 , 1 ];
3+ y = [0 , 1 , 0 ];
4+ x = [1 ,0 ,0 ];
5+ cz = 1.2 ;
6+ h = 15 ;
7+ cxy = 13.7 ;
8+ size = [cxy, cxy, h];
9+ z1 = - h / 2 ;
10+ sizeb = [cxy + 1 , cxy, cz];
11+ z2 = - cz * 1.5 ;
12+ sizet = [cxy + 2 , cxy + 2 , 4 ];
13+ sizef = [cxy + 5 , cxy + 5 , h];
14+ z4 = - sizef[2 ] / 2 ;
1415
1516if ($ preview) import("/home/paulg/Downloads/kailh_low.stl" );
1617module hole() {
17- translate (z1* z)cube (size,center= true );
18- translate (z2* z)cube (sizeb,center= true );
19- translate (2 * z)cube (sizet,center= true );
18+ translate (z1 * z)cube (size, center = true );
19+ translate (z2 * z)cube (sizeb, center = true );
20+ translate (2 * z)cube (sizet, center = true );
2021}
2122
2223module handlebar()
2324{
24- translate ((25 )/2 * y- 18.5 * z)rotate ([90 ,0 ,0 ])cylinder (d= 25.4 ,h= 50 );
25- }
26-
27- module cable() {hull() {
28- translate ([4.5 ,0 ,- 5 ])rotate ([90 ,0 ,0 ])cylinder (d= 4 ,h= 20 );
29- translate ([4.5 ,0 ,- 12 ])rotate ([90 ,0 ,0 ])cylinder (d= 4 ,h= 20 );
25+ # translate ((50 ) / 2 * y - 18.5 * z)rotate ([90 , 0 , 0 ])cylinder (d = 25.4 , h = 50 );
26+ }
3027
28+ module cable() {
29+ hull () {
30+ translate ([4.5 , 0 , - 5 ])rotate ([90 , 0 , 0 ])cylinder (d = 4 , h = 20 );
31+ translate ([4.5 , 0 , - 12 ])rotate ([90 , 0 , 0 ])cylinder (d = 4 , h = 20 );
32+ }
3133}
32- }
33- difference () {
34- translate (z4* z)cube (sizef,center= true );
35- hole();
3634
37- handlebar();
35+ difference () {
36+ union () {
37+ translate (z4 * z)cube (sizef, center = true );
38+ translate (- 4 * z)cube ([5 , cxy+ 16 , 8 ],center= true );
39+ }
40+ hole();
41+ #for (i= [- 1 ,1 ]) translate ((cxy + 8 ) / 2 * y* i) rubber_ring();
42+ handlebar();
3843 cable();
3944}
4045
46+ module rubber_ring() {
47+ translate (- 18.5 * z)
48+ rotate ([90 , 0 , 0 ])
49+ rotate_extrude()
50+ translate ([25.4 / 2 + 1.5 + 1 , 0 , 0 ])
51+ {
52+ hull () {
53+ circle(d = 3 );
54+ translate ([5 , 0 , 0 ])circle(d = 3 );}
55+ }
56+ }
57+
58+
59+ module bottom_shape(diam=5) {
60+ difference () {
61+ translate ([0 , 0 , - 7.5 ])cube ([15 , 15 , 15 ], center = true );
62+ translate (2 * z)handlebar();
63+ for (i = [- 1 , 1 ])rotate ([0 , 25 * i, 0 ])translate ([i * (diam+ 1.5 ), 0 , 0 ])rotate_extrude() hull () {
64+ translate ([4 , 0 , 0 ]) circle(d = 3 );
65+ translate ([4 , 4 , 0 ]) circle(d = 3 );
66+ }
67+
68+ }
69+
70+ }
71+
72+ // rotate(-x*90)linear_extrude(cxy-5*3)
73+ module bottom(width=cxy, diam=5) {
74+ rotate (- x * 90 )linear_extrude(cxy - diam) projection(cut = true ) {
75+ rotate (x * 90 )bottom_shape(diam);
76+ }
77+ difference () {
78+ bottom_shape(diam);
79+ translate (y * 20 )cube ([40 , 40 , 40 ], center = true );
80+ }
81+ translate (y * (width - diam))difference () {
82+ bottom_shape(diam);
83+ translate (- y * 20 )cube ([40 , 40 , 40 ], center = true );
84+ }
85+ }
86+
87+ translate (y* 40 ) bottom();
0 commit comments