S&B Volcano vaporizer remote control with Pi Pico W
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

case.scad 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * case.scad
  3. *
  4. * https://github.com/kauzerei/OpensCadaver/blob/main/models/pico_stuff.scad
  5. *
  6. * Copyright (c) 2023 Kauzerei (openautolab@kauzerei.de)
  7. * Copyright (c) 2023 Thomas Buck (thomas@xythobuz.de)
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation, either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * See <http://www.gnu.org/licenses/>.
  20. */
  21. // https://www.waveshare.com/wiki/Pico-LCD-1.3
  22. lcd_w = 52.0;
  23. lcd_h = 26.5;
  24. lcd_d = 1.0; // todo
  25. // https://www.printables.com/model/210898-raspberry-pi-pico-case
  26. use <pico_case.scad>
  27. p_w = 21;
  28. p_h = 51;
  29. p_t = 1.0;
  30. p_usb_h = 2.8;
  31. pico_header_h = 2.5; // todo
  32. lcd_header_h = 10.0; // todo
  33. header_h = pico_header_h + lcd_header_h;
  34. part="OPT_assembly"; //[bottom,top,button,print,OPT_assembly]
  35. wall=1.5;
  36. extra=4; //lip on the lid that presses top pcb down
  37. thread=3;
  38. air=0.5;
  39. bissl=1/100;
  40. button = 4;
  41. button_hole = button + 1.0;
  42. button_stem = button - 0.4;
  43. button_cut_side = 0.6;
  44. joystick=6;
  45. height=16.8+air+extra;
  46. width=52.4+1.5+2*air;
  47. length=26.7+2*air;
  48. $fa=1/1;
  49. $fs=1/2;
  50. total_width = width+2*wall;
  51. total_len = length+4*wall+2*thread;
  52. module lcd() {
  53. color("blue")
  54. translate([-lcd_h / 2, -lcd_w / 2, 0])
  55. cube([lcd_h, lcd_w, lcd_d]);
  56. }
  57. module hw() {
  58. translate([0, 0, header_h])
  59. lcd();
  60. translate([p_w / 2, -p_h / 2, 0])
  61. rotate([0, 180, 0])
  62. pico();
  63. }
  64. module bottom() {
  65. difference() {
  66. cube([total_width, total_len, height + wall]);
  67. translate([wall,2*wall+thread,wall])cube([width,length,height+bissl]);
  68. for (tr=[[wall+thread/2,wall+thread/2,height/2+wall],
  69. [wall+thread/2,length+3*wall+1.5*thread,height/2+wall],
  70. [width+wall-thread/2,wall+thread/2,height/2+wall],
  71. [width+wall-thread/2,length+3*wall+1.5*thread,height/2+wall]])
  72. translate(tr) cylinder(h=height/2+bissl,d=thread);
  73. translate([wall/2,2*wall+thread+length/2,3-bissl])cube([wall+bissl,8,6],center=true);
  74. translate([0,2*wall+thread+length/2,wall+7])rotate([0,90,0])cylinder(d=button,h=2*wall+bissl,center=true);
  75. }
  76. }
  77. module top() {
  78. difference() {
  79. cube([total_width, total_len, wall]);
  80. for (tr=[[wall+thread/2,wall+thread/2,-bissl],
  81. [wall+thread/2,length+3*wall+1.5*thread,-bissl],
  82. [width+wall-thread/2,wall+thread/2,-bissl],
  83. [width+wall-thread/2,length+3*wall+1.5*thread,-bissl]])
  84. translate(tr) cylinder(h=wall+2*bissl,d=thread);
  85. translate([wall+1.5,2*wall+thread,-bissl])
  86. for (tr=[[47.7+air,5.5+0],
  87. [47.7+air,5.5+5.7],
  88. [47.7+air,5.5+2*5.7],
  89. [47.7+air,5.5+3*5.7],
  90. [6.7+0.5,13.8+air]])
  91. translate(tr) cylinder(h=wall+2*bissl,d=button);
  92. translate([wall+1.5+6.7+air,2*wall+thread+13.8+air,-bissl]) cylinder(h=wall+2*bissl,d=joystick);
  93. translate([wall+13.5+1.5,2*wall+thread,-bissl])cube([31,27,wall+2*bissl]);
  94. }
  95. translate([wall+13.5+1.5-1.5,2*wall+thread,-extra])cube([1.5,27,extra]);
  96. translate([wall+13.5+1.5+31,2*wall+thread,-extra])cube([1.5,27,extra]);
  97. }
  98. module button() {
  99. difference() {
  100. cylinder(h = 1, d = button_hole);
  101. translate([button_hole / 2 * -3 + button_cut_side, -button_hole / 2 - 0.1, -0.1])
  102. cube([button_hole, button_hole + 0.2, 1.2]);
  103. }
  104. cylinder(h = 4, d = button_stem);
  105. }
  106. module bottom_assm() {
  107. %translate([0, 0, wall + p_t + p_usb_h])
  108. rotate([0, 0, 90])
  109. hw();
  110. translate([-total_width / 2, -total_len / 2, 0])
  111. bottom();
  112. }
  113. if (part == "bottom") {
  114. bottom_assm();
  115. } else if (part == "top") {
  116. rotate([180, 0, 0])
  117. top();
  118. } else if (part == "button") {
  119. button();
  120. } else if (part == "print"){
  121. translate([0, 10, 0])
  122. bottom();
  123. translate([0, -10, wall])
  124. rotate([180, 0, 0])
  125. top();
  126. for (i = [1 : 4])
  127. translate([-10, -25 + i * 10, 0])
  128. button();
  129. } else {
  130. difference() {
  131. union() {
  132. bottom_assm();
  133. translate([-total_width / 2, -total_len / 2, height + wall])
  134. top();
  135. for (tr = [
  136. [47.7+air,5.5+0],
  137. [47.7+air,5.5+5.7],
  138. [47.7+air,5.5+2*5.7],
  139. [47.7+air,5.5+3*5.7]
  140. ])
  141. translate(tr)
  142. translate([wall + 1.5, 2 * wall + thread, -1])
  143. translate([-total_width / 2, -total_len / 2, height + wall])
  144. button();
  145. }
  146. translate([-total_width / 2 - 1, 0, -2])
  147. cube([total_width + 2, total_len / 2 + 2, height + wall + 10]);
  148. }
  149. }