prototype-plates.scad 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // License: CC0
  2. //
  3. FN=20;
  4. hole_width = 162.5;
  5. hole_height = 107.5;
  6. bottom_plate_width = 90;
  7. bottom_plate_height = 70;
  8. rpi_center_x = -22;
  9. rpi_center_y = -8;
  10. rpi_hole_x_length = 58;
  11. rpi_hole_y_length = 48;
  12. m2r=1;
  13. m3r=1.75;
  14. m6r=3;
  15. screen_width = 122;
  16. screen_height = 76;
  17. module rounded_rect(w,h,r) {
  18. _w = w-2*r;
  19. _h = h-2*r;
  20. x2 = _w/2;
  21. y2 = _h/2;
  22. hull() {
  23. translate([-x2, y2]) circle(r, $fn=FN);
  24. translate([ x2, y2]) circle(r, $fn=FN);
  25. translate([ x2,-y2]) circle(r, $fn=FN);
  26. translate([-x2,-y2]) circle(r, $fn=FN);
  27. }
  28. }
  29. module top_plate() {
  30. _outr = 16;
  31. _r = 3;
  32. w2 = hole_width/2;
  33. h2 = hole_height/2;
  34. difference() {
  35. rounded_rect(hole_width+_outr, hole_height+_outr, _r);
  36. translate([-w2, h2]) circle(m3r, $fn=FN);
  37. translate([ w2, h2]) circle(m3r, $fn=FN);
  38. translate([ w2+0.5,-h2+2.5]) circle(m3r, $fn=FN);
  39. translate([-w2+2.5,-h2+1.5]) circle(m3r, $fn=FN);
  40. square([screen_width,screen_height], center=true);
  41. // notch
  42. translate([-w2 + 30, h2+_outr/2]) rounded_rect(10,10,_r);
  43. }
  44. }
  45. module back_plate() {
  46. cx = rpi_center_x/2;
  47. cy = rpi_center_y/2;
  48. //x = bottom_plate_width;
  49. //y = bottom_plate_height;
  50. _outr = 16;
  51. w2 = hole_width/2;
  52. h2 = hole_height/2;
  53. x = hole_width + _outr;
  54. y = hole_height + _outr;
  55. first_hole_dx = 24.0;
  56. first_hole_dy = 4.0;
  57. first_hole_x = -(screen_width/2 - first_hole_dx);
  58. first_hole_y = (screen_height/2 - first_hole_dy);
  59. _r = 3;
  60. sx2 = hole_width/2;
  61. sy2 = hole_height/2;
  62. difference() {
  63. rounded_rect(x,y,_r);
  64. translate([55,0]) rounded_rect(50,90,2);
  65. translate([-60,0]) rounded_rect(30,90,2);
  66. //translate([-40,35]) rounded_rect(70,40,2);
  67. //translate([ 40,35]) rounded_rect(70,40,2);
  68. //translate([ 41,-25]) rounded_rect(68,60,2);
  69. translate([first_hole_x, first_hole_y])
  70. translate([0,0]) circle(m2r, $fn=FN);
  71. translate([first_hole_x, first_hole_y])
  72. translate([rpi_hole_x_length,0]) circle(m2r, $fn=FN);
  73. translate([first_hole_x, first_hole_y])
  74. translate([rpi_hole_x_length,-rpi_hole_y_length]) circle(m2r, $fn=FN);
  75. translate([first_hole_x, first_hole_y])
  76. translate([0,-rpi_hole_y_length]) circle(m2r, $fn=FN);
  77. translate([sx2,sy2]) circle(m3r, $fn=FN);
  78. translate([sx2+0.5,-sy2+2.5]) circle(m3r, $fn=FN);
  79. translate([-sx2+2.5,-sy2+1.5]) circle(m3r, $fn=FN);
  80. translate([-sx2,sy2]) circle(m3r, $fn=FN);
  81. // notch
  82. translate([-w2 + 30, h2+_outr/2]) rounded_rect(10,10,_r);
  83. }
  84. }
  85. //back_plate();
  86. //translate([0,150]) top_plate();
  87. top_plate();