Browse Source

add more rounded cubes and pre/post z rotate for the switches

phschoen 1 year ago
parent
commit
f1e361cf72
1 changed files with 44 additions and 15 deletions
  1. 44
    15
      hardware/trackball.scad

+ 44
- 15
hardware/trackball.scad View File

149
 mx_co_w = 14.0;
149
 mx_co_w = 14.0;
150
 mx_co_w_add = 0.8;
150
 mx_co_w_add = 0.8;
151
 mx_co_h = 14.0;
151
 mx_co_h = 14.0;
152
+mx_co_keycap_w = mx_co_w + 2.5*2;
153
+mx_co_keycap_h = mx_co_h + 2.5*2;
152
 mx_co_h_off_1 = 1.0;
154
 mx_co_h_off_1 = 1.0;
153
 mx_co_h_off_2 = 3.5;
155
 mx_co_h_off_2 = 3.5;
154
 mx_co_h_off_3 = mx_co_h - 2 * (mx_co_h_off_1 + mx_co_h_off_2);
156
 mx_co_h_off_3 = mx_co_h - 2 * (mx_co_h_off_1 + mx_co_h_off_2);
179
 roller_small_hole = sphere_r_at_h(roller_ball_hold_off, roller_dia / 2) * 2;
181
 roller_small_hole = sphere_r_at_h(roller_ball_hold_off, roller_dia / 2) * 2;
180
 
182
 
181
 roller_ridge_h = 1.5;
183
 roller_ridge_h = 1.5;
182
-roller_mount_angle_off = 90;
184
+roller_mount_angle_off = 90-5;
183
 roller_mount_dia = roller_thread_dia + 2.0;
185
 roller_mount_dia = roller_thread_dia + 2.0;
184
 
186
 
185
 ball_h = 15; // todo
187
 ball_h = 15; // todo
191
 
193
 
192
 sensor_pcb_support_h = 1.6 + 3.4;
194
 sensor_pcb_support_h = 1.6 + 3.4;
193
 //         rotate                                     translate
195
 //         rotate                                     translate
194
-sw = [
195
-        [ [-5,0, -30 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 0,-17]],
196
-        [ [-5,0,  15 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 0,-17]],
197
-        [ [-5,0, 125 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 0,-17]],
198
-        [ [-5,0,-125 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 0,-17]],
196
+sw = [   // x z_pre_T z_post_T
197
+        [ [-5,      0, -33 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 2,-14.5]],// thumb
198
+        [ [-5,    -15,   3 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 2,-14.5]],// thumb
199
+        //[ [-5,      0, -70 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 0,-14.5]],// thumb
200
+        [ [-5,    -15, 140 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 3,-14.5]],// middle
201
+        [ [-5,      0, 100 * (left_hand_version ? -1 : 1)], [0,-base_dia / 2 - 2,-14.5]],// ring
199
     ];
202
     ];
200
 
203
 
201
 sw_mount_w = mx_co_w + 7;
204
 sw_mount_w = mx_co_w + 7;
261
         
264
         
262
         translate([mx_co_w_add - mx_co_b_add / 2, -mx_co_b_add / 2, -1])
265
         translate([mx_co_w_add - mx_co_b_add / 2, -mx_co_b_add / 2, -1])
263
         cube([mx_co_b_w, mx_co_b_h, h - mx_co_th + 1]);
266
         cube([mx_co_b_w, mx_co_b_h, h - mx_co_th + 1]);
267
+        
264
     }
268
     }
269
+    
270
+    
271
+    translate([-mx_co_keycap_w/2,-mx_co_keycap_h/2, h])
272
+    cube([mx_co_keycap_w, mx_co_keycap_h, 50]);
265
 }
273
 }
266
 
274
 
267
 module mx_switch_test() {
275
 module mx_switch_test() {
548
     roller_mount_sensor_pcb_support();
556
     roller_mount_sensor_pcb_support();
549
 }
557
 }
550
 
558
 
559
+module fully_rounded_cube(p,r,center) {
560
+    for(x=[r,p[0]-r],
561
+        y=[r,p[1]-r],
562
+        z=[r,p[2]-r]
563
+    ){
564
+        translate([x,y,z])
565
+        sphere(r,$fn=$fn/8);
566
+    }
567
+}
551
 module trackball_top() {
568
 module trackball_top() {
552
     translate([0, 0, ball_dia / 2 + ball_h]) {
569
     translate([0, 0, ball_dia / 2 + ball_h]) {
553
         if (draw_ball_roller)
570
         if (draw_ball_roller)
556
         difference() {
573
         difference() {
557
             color("orange")
574
             color("orange")
558
             hull() {
575
             hull() {
576
+                r=4;
559
                 roller_mount_tri_hull();
577
                 roller_mount_tri_hull();
560
                 for ( i = [0:len(sw)-1] ){
578
                 for ( i = [0:len(sw)-1] ){
561
-                    rotate([0,sw[i][0][1],sw[i][0][2]])
579
+                    rotate([0,0,sw[i][0][2]])
562
                     translate(sw[i][1])
580
                     translate(sw[i][1])
563
-                    rotate([90+sw[i][0][0],0,0])
564
-                    translate([0, 0, -0.5])
565
-                    cube([sw_mount_w, sw_mount_w, 1], center = true);
581
+                    rotate([90+sw[i][0][0],0,sw[i][0][1]])
582
+                    translate([-sw_mount_w/2-r, -sw_mount_w/2-r, -r-r/2])
583
+                    fully_rounded_cube([sw_mount_w+r*2, sw_mount_w+r*2, 0], r);
566
                 }
584
                 }
567
             }
585
             }
568
             
586
             
574
             
592
             
575
             
593
             
576
             for ( i = [0:len(sw)-1] ){
594
             for ( i = [0:len(sw)-1] ){
577
-                rotate([0,sw[i][0][1],sw[i][0][2]])
595
+                rotate([0,0,sw[i][0][2]])
578
                 translate(sw[i][1])
596
                 translate(sw[i][1])
579
-                rotate([90+sw[i][0][0],0,0])
597
+                rotate([90+sw[i][0][0],0,sw[i][0][1]])
580
                 translate([0, 0, -sw_mount_co_l]) {
598
                 translate([0, 0, -sw_mount_co_l]) {
581
                     mx_switch_cutout(sw_mount_co_l + 1);
599
                     mx_switch_cutout(sw_mount_co_l + 1);
582
                     
600
                     
592
             translate([screw_off, 0, -ball_dia / 2 - 11 -1]) {
610
             translate([screw_off, 0, -ball_dia / 2 - 11 -1]) {
593
                 cylinder(d = screw_insert_dia, h = screw_insert_h + 1);
611
                 cylinder(d = screw_insert_dia, h = screw_insert_h + 1);
594
             }
612
             }
613
+            
614
+            
615
+            
595
         }
616
         }
596
         
617
         
597
         roller_mount_sensor_pcb_support();
618
         roller_mount_sensor_pcb_support();
598
     
619
     
599
         if (draw_switches)
620
         if (draw_switches)
600
         for ( i = [0:len(sw)-1] ){
621
         for ( i = [0:len(sw)-1] ){
601
-            rotate([0,sw[i][0][1],sw[i][0][2]])
622
+            rotate([0,0,sw[i][0][2]])
623
+            translate(sw[i][1])
624
+            rotate([90+sw[i][0][0],0,sw[i][0][1]])
625
+            translate([0, 0, 1.])
626
+            mx_switch($t);
627
+        }
628
+        if (draw_keycap)
629
+        for ( i = [0:len(sw)-1] ){
630
+            rotate([0,0,sw[i][0][2]])
602
             translate(sw[i][1])
631
             translate(sw[i][1])
603
-            rotate([90+sw[i][0][0],0,0])
604
-                translate([0, 0, 1.])
632
+            rotate([90+sw[i][0][0],0,sw[i][0][1]])
633
+            translate([0, 0, 1.])
605
             mx_switch($t);
634
             mx_switch($t);
606
         }
635
         }
607
     }
636
     }

Loading…
Cancel
Save