Pārlūkot izejas kodu

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

phschoen 1 gadu atpakaļ
vecāks
revīzija
f1e361cf72
1 mainītis faili ar 44 papildinājumiem un 15 dzēšanām
  1. 44
    15
      hardware/trackball.scad

+ 44
- 15
hardware/trackball.scad Parādīt failu

@@ -149,6 +149,8 @@ sensor_lens_off = 10.97;
149 149
 mx_co_w = 14.0;
150 150
 mx_co_w_add = 0.8;
151 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 154
 mx_co_h_off_1 = 1.0;
153 155
 mx_co_h_off_2 = 3.5;
154 156
 mx_co_h_off_3 = mx_co_h - 2 * (mx_co_h_off_1 + mx_co_h_off_2);
@@ -179,7 +181,7 @@ roller_thread_hole = roller_dia - 1;
179 181
 roller_small_hole = sphere_r_at_h(roller_ball_hold_off, roller_dia / 2) * 2;
180 182
 
181 183
 roller_ridge_h = 1.5;
182
-roller_mount_angle_off = 90;
184
+roller_mount_angle_off = 90-5;
183 185
 roller_mount_dia = roller_thread_dia + 2.0;
184 186
 
185 187
 ball_h = 15; // todo
@@ -191,11 +193,12 @@ sensor_pcb_mount_gap = 2.0;
191 193
 
192 194
 sensor_pcb_support_h = 1.6 + 3.4;
193 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 204
 sw_mount_w = mx_co_w + 7;
@@ -261,7 +264,12 @@ module mx_switch_cutout(h) {
261 264
         
262 265
         translate([mx_co_w_add - mx_co_b_add / 2, -mx_co_b_add / 2, -1])
263 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 275
 module mx_switch_test() {
@@ -548,6 +556,15 @@ module roller_mount_tri() {
548 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 568
 module trackball_top() {
552 569
     translate([0, 0, ball_dia / 2 + ball_h]) {
553 570
         if (draw_ball_roller)
@@ -556,13 +573,14 @@ module trackball_top() {
556 573
         difference() {
557 574
             color("orange")
558 575
             hull() {
576
+                r=4;
559 577
                 roller_mount_tri_hull();
560 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 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,9 +592,9 @@ module trackball_top() {
574 592
             
575 593
             
576 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 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 598
                 translate([0, 0, -sw_mount_co_l]) {
581 599
                     mx_switch_cutout(sw_mount_co_l + 1);
582 600
                     
@@ -592,16 +610,27 @@ module trackball_top() {
592 610
             translate([screw_off, 0, -ball_dia / 2 - 11 -1]) {
593 611
                 cylinder(d = screw_insert_dia, h = screw_insert_h + 1);
594 612
             }
613
+            
614
+            
615
+            
595 616
         }
596 617
         
597 618
         roller_mount_sensor_pcb_support();
598 619
     
599 620
         if (draw_switches)
600 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 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 634
             mx_switch($t);
606 635
         }
607 636
     }

Notiek ielāde…
Atcelt
Saglabāt