PIU-box-interim.scad 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // License: CC0
  2. //
  3. // units in mm
  4. $fn = 50;
  5. M3_H3_DRILL_R = 4.3127/2;
  6. RFID_screw_diam = 3;
  7. RFID_screw_dw = 103.5;
  8. RFID_access_diam = 15.5;
  9. MAG_PCB_screw_dw = 81.5;
  10. MAG_PCB_screw_diam = 2;
  11. MAG_READER_screw_dw = 93.75;
  12. MAG_READER_screw_diam = 3;
  13. MAG_ACCESS_total_width = 25;
  14. MAG_ACCESS_small_width = 10;
  15. MAG_ACCESS_total_height = 95;
  16. MAG_ACCESS_section = [17,16,29,16,17];
  17. SCREEN_screw_diam = 3;
  18. SCREEN_dw = 186;
  19. SCREEN_dh = 54;
  20. SCREEN_WINDOW_h = 46;
  21. SCREEN_WINDOW_w = 160;
  22. BOARD_screw_diam = 3;
  23. BOARD_screw_dw = 76.25;
  24. BOARD_screw_dh = 101.5;
  25. PIU_width = 200;
  26. PIU_height = 160;
  27. PIU_side = 50;
  28. module PIU_face() {
  29. difference() {
  30. // central face
  31. //
  32. square([PIU_width, PIU_height], center=true);
  33. // screen
  34. //
  35. translate([0, PIU_height/2 - SCREEN_WINDOW_h/2 - 10])
  36. union() {
  37. square([SCREEN_WINDOW_w, SCREEN_WINDOW_h], center=true);
  38. translate([-SCREEN_dw/2, SCREEN_dh/2]) circle(SCREEN_screw_diam/2);
  39. translate([ SCREEN_dw/2, SCREEN_dh/2]) circle(SCREEN_screw_diam/2);
  40. translate([ SCREEN_dw/2,-SCREEN_dh/2]) circle(SCREEN_screw_diam/2);
  41. translate([-SCREEN_dw/2,-SCREEN_dh/2]) circle(SCREEN_screw_diam/2);
  42. }
  43. // mag
  44. //
  45. translate([0, -5])
  46. union() {
  47. square([MAG_ACCESS_total_height, MAG_ACCESS_small_width], center=true);
  48. translate([-MAG_ACCESS_section[1]/2 - MAG_ACCESS_section[2]/2, 0])
  49. square([MAG_ACCESS_section[1], MAG_ACCESS_total_width], center=true);
  50. translate([ MAG_ACCESS_section[3]/2 + MAG_ACCESS_section[2]/2, 0])
  51. square([MAG_ACCESS_section[3], MAG_ACCESS_total_width], center=true);
  52. rotate( 15, [0,0,1]) translate([-MAG_PCB_screw_dw/2, 0]) circle(MAG_PCB_screw_diam/2);
  53. rotate( 15, [0,0,1]) translate([ MAG_PCB_screw_dw/2, 0]) circle(MAG_PCB_screw_diam/2);
  54. rotate(-15, [0,0,1]) translate([-MAG_PCB_screw_dw/2, 0]) circle(MAG_PCB_screw_diam/2);
  55. rotate(-15, [0,0,1]) translate([ MAG_PCB_screw_dw/2, 0]) circle(MAG_PCB_screw_diam/2);
  56. rotate( 15, [0,0,1]) translate([-MAG_READER_screw_dw/2, 0]) circle(MAG_READER_screw_diam/2);
  57. rotate( 15, [0,0,1]) translate([ MAG_READER_screw_dw/2, 0]) circle(MAG_READER_screw_diam/2);
  58. rotate(-15, [0,0,1]) translate([-MAG_READER_screw_dw/2, 0]) circle(MAG_READER_screw_diam/2);
  59. rotate(-15, [0,0,1]) translate([ MAG_READER_screw_dw/2, 0]) circle(MAG_READER_screw_diam/2);
  60. }
  61. // RFID
  62. //
  63. translate([0,-55])
  64. union() {
  65. translate([-RFID_screw_dw/2,0]) circle(RFID_screw_diam/2);
  66. translate([ RFID_screw_dw/2,0]) circle(RFID_screw_diam/2);
  67. circle(RFID_access_diam/2);
  68. }
  69. }
  70. }
  71. module PIU() {
  72. _c = 1;
  73. union() {
  74. PIU_face();
  75. // side left and right
  76. //
  77. translate([_c + PIU_width/2 + PIU_side/2, 0])
  78. square([PIU_side, PIU_height], center=true);
  79. translate([-(_c + PIU_width/2 + PIU_side/2), 0])
  80. square([PIU_side, PIU_height], center=true);
  81. // top and bottom
  82. //
  83. translate([0, _c + PIU_height/2 + PIU_side/2])
  84. square([PIU_width, PIU_side], center=true);
  85. translate([0, -(_c + PIU_height/2 + PIU_side/2)])
  86. square([PIU_width, PIU_side], center=true);
  87. // connecting strips
  88. //
  89. translate([-PIU_width/2 - _c/2, 0]) square([_c+0.25, PIU_height], center=true);
  90. translate([ PIU_width/2 + _c/2, 0]) square([_c+0.25, PIU_height], center=true);
  91. translate([ 0, PIU_height/2 + _c/2]) square([PIU_width, _c+0.25], center=true);
  92. translate([ 0, -(PIU_height/2 + _c/2)]) square([PIU_width, _c+0.25], center=true);
  93. }
  94. }
  95. module PIU_back_bracket() {
  96. _w = 20;
  97. _dx = PIU_width/2 - _w/2;
  98. _dy = PIU_height/2 - _w/2;
  99. _drill_r = M3_H3_DRILL_R;
  100. difference() {
  101. square([PIU_width, PIU_height], center=true);
  102. square([PIU_width - 2*_w, PIU_height - 2*_w], center=true);
  103. translate([ -_dx, -_dy]) circle(_drill_r);
  104. translate([ _dx, -_dy]) circle(_drill_r);
  105. translate([ _dx, _dy]) circle(_drill_r);
  106. translate([ -_dx, _dy]) circle(_drill_r);
  107. }
  108. }
  109. PIU();
  110. translate([0,240]) PIU_back_bracket();