Browse Source

mount pi at the top part for less cable lengths

phschoen 1 year ago
parent
commit
17cf5a5de4
1 changed files with 59 additions and 45 deletions
  1. 59
    45
      hardware/trackball.scad

+ 59
- 45
hardware/trackball.scad View File

38
 // ######################
38
 // ######################
39
 
39
 
40
 //ball_and_roller();
40
 //ball_and_roller();
41
-//pico_wrap();
41
+pico_wrap();
42
 //sensor();
42
 //sensor();
43
 //mx_switch_cutout(wall);
43
 //mx_switch_cutout(wall);
44
 //mx_switch_test();
44
 //mx_switch_test();
47
 //roller_holder();
47
 //roller_holder();
48
 //roller_mount_tri();
48
 //roller_mount_tri();
49
 
49
 
50
-//trackball_top();
51
-//trackball_bottom();
50
+trackball_top();
51
+trackball_bottom();
52
 
52
 
53
-assembly();
53
+//assembly();
54
 //print();
54
 //print();
55
 
55
 
56
 // #######################
56
 // #######################
222
 
222
 
223
 usb_cutout_grow_l = 10;
223
 usb_cutout_grow_l = 10;
224
 usb_cutout_grow_x = 20;
224
 usb_cutout_grow_x = 20;
225
-usb_cutout_grow_y = 40;
225
+usb_cutout_grow_y = 10;
226
 usb_cutout_w_add = 1;
226
 usb_cutout_w_add = 1;
227
 usb_cutout_h_add = 0.6;
227
 usb_cutout_h_add = 0.6;
228
 
228
 
265
         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])
266
         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
         
267
         
268
+        
268
     }
269
     }
269
     
270
     
270
     
271
     
272
+    
271
     translate([-mx_co_keycap_w/2,-mx_co_keycap_h/2, h])
273
     translate([-mx_co_keycap_w/2,-mx_co_keycap_h/2, h])
272
     cube([mx_co_keycap_w, mx_co_keycap_h, 50]);
274
     cube([mx_co_keycap_w, mx_co_keycap_h, 50]);
273
 }
275
 }
308
 }
310
 }
309
 
311
 
310
 module pico_wrap() {
312
 module pico_wrap() {
311
-    //if (use_external_pico_model)
312
-    translate([-pico_w / 2, -pico_l / 2, 0])
313
-    pico();
314
-    //else
315
-    pico_own();
313
+    translate([0,0,3.9])
314
+    rotate([0,180,0])
315
+    if (use_external_pico_model)
316
+        translate([-pico_w / 2, -pico_l / 2, 0])
317
+        pico();
318
+    else
319
+        pico_own();
316
 }
320
 }
317
 
321
 
318
 module sensor_lens_cutout_intern() {
322
 module sensor_lens_cutout_intern() {
386
 }
390
 }
387
 module ball_and_roller() {
391
 module ball_and_roller() {
388
     color("red")
392
     color("red")
389
-    sphere(d = ball_dia, $fn = $fn * 2);
393
+    sphere(d = ball_dia, $fn = $fn);
390
     
394
     
391
     for (r = [0 : roller_count - 1])
395
     for (r = [0 : roller_count - 1])
392
     rotate([0, 0, roller_mount_angle_off + 360 / roller_count * r])
396
     rotate([0, 0, roller_mount_angle_off + 360 / roller_count * r])
414
         cylinder(d = roller_thread_hole, h = $e+ roller_h - roller_dia / 2 + roller_ball_h_off + roller_ball_hold_off);
418
         cylinder(d = roller_thread_hole, h = $e+ roller_h - roller_dia / 2 + roller_ball_h_off + roller_ball_hold_off);
415
     
419
     
416
         translate([0, 0, roller_h - roller_dia / 2 + roller_holder_h_compensation])
420
         translate([0, 0, roller_h - roller_dia / 2 + roller_holder_h_compensation])
417
-        sphere(d = roller_dia, $fn = $fn * 2);
421
+        sphere(d = roller_dia, $fn = $fn);
418
 
422
 
419
         if (cut_roller_holder)
423
         if (cut_roller_holder)
420
         translate([-roller_thread_dia / 2 - 1, -roller_thread_dia, -1])
424
         translate([-roller_thread_dia / 2 - 1, -roller_thread_dia, -1])
422
     }
426
     }
423
     
427
     
424
     %color("blue")
428
     %color("blue")
425
-    sphere(d = roller_dia, $fn = $fn * 2);
429
+    sphere(d = roller_dia, $fn = $fn);
426
 }
430
 }
427
 
431
 
428
 module roller_mount() {
432
 module roller_mount() {
601
                     translate([0, 0, 2])
605
                     translate([0, 0, 2])
602
                     rotate([90, 0, 0])
606
                     rotate([90, 0, 0])
603
                     cylinder(d = 4, h = 20);
607
                     cylinder(d = 4, h = 20);
608
+                    
609
+                    rotate([0,-sw[i][0][1],0])
610
+                    translate([0,-15,3])
611
+                    rotate([0,180,0])
612
+                    cylinder(d=3,h=40);
604
                 }
613
                 }
605
             }
614
             }
606
             
615
             
611
                 cylinder(d = screw_insert_dia, h = screw_insert_h + 1);
620
                 cylinder(d = screw_insert_dia, h = screw_insert_h + 1);
612
             }
621
             }
613
             
622
             
623
+            for (x = [0, pico_hole_d_x])
624
+            for (y = [0, pico_hole_d_y])
625
+                rotate([0,0,0])
626
+            translate([-pico_w / 2, -pico_l / 2, -25])
627
+            translate([pico_hole_x + x, pico_hole_y + y, -pico_d - pico_screw_depth])
628
+            cylinder(d = pico_screw_d, h = pico_d + pico_screw_depth + 1);
614
             
629
             
630
+            rotate([0, 180, 0])
631
+            translate([-pico_w / 2, -pico_l / 2, 0])
632
+            translate([(pico_w - pico_usb_w) / 2, pico_l - 1 + pico_usb_off, 30])
633
+            usb_cutout();
615
             
634
             
616
         }
635
         }
617
         
636
         
637
+         
618
         roller_mount_sensor_pcb_support();
638
         roller_mount_sensor_pcb_support();
619
     
639
     
620
         if (draw_switches)
640
         if (draw_switches)
637
 }
657
 }
638
 
658
 
639
 module trackball_bottom_wrap() {
659
 module trackball_bottom_wrap() {
640
-    %rotate([0, 180, 0])
641
-    pico_wrap();
642
     
660
     
643
     color("magenta")
661
     color("magenta")
644
-    translate([0, 0, -bottom_base_below_zero])
662
+    translate([0, 0, -3.0])
645
     difference() {
663
     difference() {
646
-        cylinder(d = base_dia, h = bottom_base_below_zero + ball_h - 11);
664
+        cylinder(d = base_dia, h = bottom_base_below_zero + ball_h - 16);
647
         
665
         
648
         translate([0, 0, bottom_base_wall])
666
         translate([0, 0, bottom_base_wall])
649
-        cylinder(d = base_dia - bottom_base_wall * 2 - bottom_add_wall, h = bottom_base_below_zero + ball_h - 11);
667
+        cylinder(d = base_dia - bottom_base_wall * 2 - bottom_add_wall, h = bottom_base_below_zero + ball_h - 15);
650
         
668
         
651
-        translate([-pico_co_w / 2, -pico_co_l / 2, bottom_base_wall])
669
+        translate([-pico_co_w / 2, -pico_co_l / 2, 2.5])
652
         cube([pico_co_w, pico_co_l, bottom_base_below_zero + ball_h - 11]);
670
         cube([pico_co_w, pico_co_l, bottom_base_below_zero + ball_h - 11]);
653
         
671
         
654
         translate([pico_w / 2 - reset_button_off_x, pico_l / 2 - reset_button_off_y, -1])
672
         translate([pico_w / 2 - reset_button_off_x, pico_l / 2 - reset_button_off_y, -1])
655
         cylinder(d = reset_button_dia, h = bottom_base_wall + 2);
673
         cylinder(d = reset_button_dia, h = bottom_base_wall + 2);
656
-        
657
-        if (cut_roller_holder)
658
-        translate([-base_dia / 2 - 1, -base_dia / 2 - 1, -10])
659
-        cube([base_dia / 2 + 1, base_dia + 2, 40]);
660
     }
674
     }
661
     
675
     
662
     color("cyan")
676
     color("cyan")
663
-    for (x = [-1, 1])
664
-    for (y = [-1, 1])
665
-    translate([x * (pico_co_w - pico_support_w) / 2, y * (pico_co_l - pico_support_l) / 2, 0])
666
-    translate([-pico_support_w / 2, -pico_support_l / 2, -bottom_base_below_zero + bottom_base_wall])
667
-    cube([pico_support_w, pico_support_l, bottom_base_below_zero - bottom_base_wall - pico_d]);
668
-        
669
-    color("cyan")
670
     for (r = screw_angles)
677
     for (r = screw_angles)
671
     rotate([0, 0, r])
678
     rotate([0, 0, r])
672
-    translate([screw_off, 0, -bottom_base_below_zero + bottom_base_wall])
673
-    cylinder(d = screw_head_d + 4, h = bottom_base_below_zero + ball_h - 11 - bottom_base_wall);
679
+    translate([screw_off, 0, -3])
680
+    cylinder(d = screw_head_d + 4, h = bottom_base_below_zero + ball_h - 16 );
674
 }
681
 }
675
 
682
 
676
 module usb_cutout() {
683
 module usb_cutout() {
677
-    hull() {
678
-        translate([-usb_cutout_w_add / 2, 0, -usb_cutout_h_add / 2])
679
-        cube([pico_usb_w + usb_cutout_w_add, 1, pico_usb_h + usb_cutout_h_add]);
680
-        
681
-        translate([-usb_cutout_grow_x / 2, usb_cutout_grow_l, -usb_cutout_grow_y / 2])
682
-        cube([pico_usb_w + usb_cutout_grow_x, 1, pico_usb_h + usb_cutout_grow_y]);
684
+    translate([8,1,4.5])
685
+    rotate([0,180,0]) {
686
+        translate([-usb_cutout_w_add / 2, -2, -usb_cutout_h_add / 2])
687
+        cube([pico_usb_w + usb_cutout_w_add, 5, pico_usb_h + usb_cutout_h_add]);
688
+    
689
+        hull() {
690
+            translate([-usb_cutout_w_add / 2, 1, -usb_cutout_h_add / 2])
691
+            cube([pico_usb_w + usb_cutout_w_add, $e, pico_usb_h + usb_cutout_h_add]);
692
+            
693
+            translate([-usb_cutout_grow_x / 2, 1+usb_cutout_grow_l, -usb_cutout_grow_y / 2])
694
+            cube([pico_usb_w + usb_cutout_grow_x, $e, pico_usb_h + usb_cutout_grow_y]);
695
+            
696
+            translate([-usb_cutout_grow_x / 2, 1+usb_cutout_grow_l*10, -usb_cutout_grow_y / 2])
697
+            cube([pico_usb_w + usb_cutout_grow_x, $e, pico_usb_h + usb_cutout_grow_y]);
698
+        }
683
     }
699
     }
684
 }
700
 }
685
 
701
 
702
+
703
+
686
 module trackball_bottom() {
704
 module trackball_bottom() {
687
     difference() {
705
     difference() {
688
         trackball_bottom_wrap();
706
         trackball_bottom_wrap();
689
         
707
         
690
-        for (x = [0, pico_hole_d_x])
691
-        for (y = [0, pico_hole_d_y])
692
-        translate([-pico_w / 2, -pico_l / 2, 0])
693
-        translate([pico_hole_x + x, pico_hole_y + y, -pico_d - pico_screw_depth])
694
-        cylinder(d = pico_screw_d, h = pico_d + pico_screw_depth + 1);
695
         
708
         
709
+        translate([0, 0, ball_dia / 2 + ball_h]) 
696
         rotate([0, 180, 0])
710
         rotate([0, 180, 0])
697
         translate([-pico_w / 2, -pico_l / 2, 0])
711
         translate([-pico_w / 2, -pico_l / 2, 0])
698
-        translate([(pico_w - pico_usb_w) / 2, pico_l - 1 + pico_usb_off, pico_d])
712
+        translate([(pico_w - pico_usb_w) / 2, pico_l - 1 + pico_usb_off, 30])
699
         usb_cutout();
713
         usb_cutout();
700
         
714
         
701
         for (r = screw_angles)
715
         for (r = screw_angles)
702
         rotate([0, 0, r])
716
         rotate([0, 0, r])
703
-        translate([screw_off, 0, -bottom_base_below_zero - 1]) {
717
+        translate([screw_off, 0, -$e-3]) {
704
             cylinder(d = screw_dia, h = bottom_base_below_zero + 30);
718
             cylinder(d = screw_dia, h = bottom_base_below_zero + 30);
705
             cylinder(d = screw_head_d, h = screw_head_h + 1);
719
             cylinder(d = screw_head_d, h = screw_head_h + 1);
706
         }
720
         }

Loading…
Cancel
Save