DDzwiedziu

2024_Portable_workstation_butt-remix_export.scad

Apr 9th, 2024
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.67 KB | None | 0 0
  1. // Remixing the original instructable with butt-joints
  2. // https://www.instructables.com/Make-a-Portable-Workstation/
  3.  
  4. margin = 1;
  5. wood_thickness = 9;
  6. // groove = 3;
  7.  
  8. main_ws_closed = false;
  9. side_ws_closed = true;
  10. doors_closed = true;
  11.  
  12. // Width × Depth × Thickness
  13.  
  14. // We'll build around such mat, which seems a typical size.
  15. // LOL, I've tried to made a miniature version x)
  16. // mat = [300, 220, 3];
  17.  
  18. // Thsis size fits quite well the original workspace size.
  19. // A3
  20. mat = [450, 300, 3];
  21.  
  22. // gabaryt (pol) - overall dimensions of the whole item
  23. gabaryt = [550, 215, 400];
  24.  
  25. // Main Body
  26. bottom = [gabaryt.x, gabaryt.y, wood_thickness];
  27. top = [gabaryt.x, gabaryt.y, wood_thickness];
  28. sideL = [140, gabaryt.z - 2* wood_thickness, wood_thickness];
  29. sideR = [140, gabaryt.z - 2* wood_thickness, wood_thickness];
  30. divider = [sideL.x - wood_thickness, sideL.y, wood_thickness];
  31. back = [gabaryt.x - 2* wood_thickness, gabaryt.z - 2* wood_thickness, wood_thickness];
  32.  
  33. // Doors
  34. door_width = gabaryt.x/2 - 2*margin;
  35. door_depth = bottom.y - sideL.x - 2* wood_thickness - mat.z - 2*margin;
  36. door_height = gabaryt.z - 2* wood_thickness - 2*margin;
  37.  
  38. door_bottom_L = [door_width, door_depth, wood_thickness];
  39. door_bottom_R = [door_width, door_depth, wood_thickness];
  40. door_top_L = [door_width, door_depth, wood_thickness];
  41. door_top_R = [door_width, door_depth, wood_thickness];
  42. door_L_side_L = [door_height - 2*wood_thickness, door_depth, wood_thickness];
  43. door_L_side_R = [door_height - 2*wood_thickness, door_depth, wood_thickness];
  44. door_R_side_L = [door_height - 2*wood_thickness, door_depth, wood_thickness];
  45. door_R_side_R = [door_height - 2*wood_thickness, door_depth, wood_thickness];
  46. door_back_L = [door_width - 2* wood_thickness, door_height - 2* wood_thickness, wood_thickness];
  47. door_back_R = [door_width - 2* wood_thickness, door_height - 2* wood_thickness, wood_thickness];
  48.  
  49. // Worksurface
  50. middle_ws = [gabaryt.x, gabaryt.z - wood_thickness, wood_thickness];
  51. side_ws_L = [middle_ws.x/2-1, middle_ws.y - wood_thickness - 2* margin, wood_thickness];
  52. side_ws_R = [middle_ws.x/2-1, middle_ws.y - wood_thickness - 2* margin, wood_thickness];
  53.  
  54. // If we're building around the mat, then we need to start with the main
  55. // work surface, which will in turn decide the dimensions of the base workspace
  56. // and overall station size.
  57. include <module_rotate_about_pt.scad>;
  58.  
  59. module workspaces () {
  60. mat_center_x = (middle_ws.x - mat.x)/2;
  61. translate ( [mat_center_x, mat_center_x/2, wood_thickness + margin] ) {
  62. color ( "#007d67" )
  63. cube ( mat );
  64. translate ( [margin, margin, mat.z] )
  65. color ( "black" )
  66. text ( "A3 mat" );
  67. }
  68.  
  69. cube ( middle_ws );
  70. translate ( [margin, margin, wood_thickness] )
  71. color ( "black" )
  72. text ( "main workspace" );
  73.  
  74. // Twice the margin for the hinges (at least).
  75. rotate_about_pt ([0, (side_ws_closed ? 180 : 0), 0],
  76. [-margin, 0, wood_thickness + mat.z + margin]) {
  77. translate ( [- side_ws_L.x - 2*margin, wood_thickness + margin ,0] ) {
  78. cube ( side_ws_L );
  79. translate ( [margin, margin, wood_thickness] )
  80. color ( "black" )
  81. text ( "workspace left" );
  82. }
  83. }
  84. translate ( [middle_ws.x + 2*margin, wood_thickness + margin ,0] ) {
  85. rotate_about_pt ([0, (side_ws_closed ? -180 : 0), 0],
  86. [-margin, 0, wood_thickness + mat.z + margin]) {
  87. cube ( side_ws_R );
  88. translate ( [margin, margin, wood_thickness] )
  89. color ( "black" )
  90. text ( "workspace right" );}
  91. }
  92. }
  93.  
  94. module main_box () {
  95. // Bottom
  96. translate( [0, middle_ws.y + margin, 0] ) {
  97. cube ( bottom );
  98. translate ( [margin, margin, wood_thickness] )
  99. color ( "black" )
  100. text ( "bottom" );
  101.  
  102. // Divider
  103. translate ( [bottom.x/2 - wood_thickness/2, bottom.y - divider.x - wood_thickness, wood_thickness] )
  104. rotate ( [90, 0, 90] )
  105. cube ( divider );
  106.  
  107. // Top
  108. translate ( [0, 0, gabaryt.z - wood_thickness] ) {
  109. cube ( top );
  110. translate ( [margin, margin, wood_thickness] )
  111. color ( "black" )
  112. text ( "top" );
  113. }
  114. // Back
  115. translate ( [wood_thickness, bottom.y , wood_thickness] )
  116. rotate ( [90, 0, 0] ) {
  117. cube ( back );
  118. translate ( [margin, margin, wood_thickness] )
  119. color ( "black" )
  120. text ( "back" );
  121. }
  122.  
  123. // Sides
  124. translate ( [0, bottom.y - sideL.x, wood_thickness] ) {
  125. rotate( [90, 0, 90] ){
  126. cube (sideL);
  127. // Lost this label…
  128. translate ( [margin, margin, mat.z+1] )
  129. color ( "black" )
  130. # text ( "side left" );
  131.  
  132. translate ( [0, 0, bottom.x - wood_thickness] ){
  133. cube ( sideR );
  134. translate ( [margin, margin, mat.z+1] )
  135. color ( "black" )
  136. # text ( "side right" );
  137. }
  138. }
  139.  
  140. }
  141.  
  142. // Drawers
  143. translate ( [- door_bottom_L.x - 2*margin,
  144. bottom.y - sideL.x,
  145. wood_thickness + margin] )
  146. {
  147. // Drawer L
  148. rotate_about_pt ([0,0,(doors_closed ? -180 : 0)], [door_width + margin,0,0]) {
  149. cube ( door_bottom_L );
  150.  
  151. translate ( [0, 0, door_L_side_L.x + wood_thickness] )
  152. cube ( door_top_L );
  153.  
  154. translate ( [wood_thickness , door_bottom_L.y, wood_thickness] )
  155. rotate( [90, 0, 0] )
  156. cube ( door_back_L );
  157.  
  158. translate ( [wood_thickness , 0, wood_thickness] )
  159. rotate ( [0, -90, 0] ){
  160. cube ( door_L_side_L );
  161. translate ( [0, 0, - door_width + wood_thickness] )
  162. cube ( door_L_side_R );
  163. }
  164. }
  165.  
  166. // Drawer R
  167. // rotate_about_pt ([,,], [,,])
  168.  
  169. translate ( [door_width + bottom.x + 4* margin, 0, 0] )
  170. rotate_about_pt ([0,0,(doors_closed ? -180 : 0)], [- margin,0,0]) {
  171. cube ( door_bottom_R );
  172.  
  173. translate ( [0, 0, door_R_side_L.x + wood_thickness] )
  174. cube ( door_top_L );
  175.  
  176. translate ( [wood_thickness , door_bottom_R.y, wood_thickness] )
  177. rotate( [90, 0, 0] )
  178. cube ( door_back_R );
  179.  
  180. translate ( [wood_thickness , 0, wood_thickness] )
  181. rotate ( [0, -90, 0] ){
  182. cube ( door_R_side_L );
  183. translate ( [0, 0, - door_width + wood_thickness] )
  184. cube ( door_R_side_R );
  185. }
  186. }
  187. }
  188. }
  189. }
  190.  
  191. // simulate closing the main workspace
  192. rotate_about_pt ( [( main_ws_closed ? -90 : 0), 0, 0], [0, middle_ws.y, middle_ws.z] )
  193. workspaces ();
  194. main_box ();
  195.  
  196. // Main box
  197. // {
  198. // translate ( [0, 0, 0] ) {
  199. // cube ( bottom );
  200. // translate ( [0, 0, sideA.y + wood_thickness] )
  201. // cube ( top );
  202. // }
  203.  
  204. // translate ( [0, wood_thickness, wood_thickness] )
  205. // rotate ( [90, 0, 0] ) {
  206. // cube ( sideA );
  207. // translate ( [0, 0, -bottom.y + wood_thickness] )
  208. // cube ( sideB );
  209. // }
  210.  
  211. // % translate ( [0, wood_thickness, wood_thickness] )
  212. // rotate ( [90, 0, 90] )
  213. // cube ( back );
  214. // }
  215.  
  216.  
  217. echo ( "bottom: ", bottom );
  218. echo ( "top: ", top );
  219. echo ( "sideL: ", sideL );
  220. echo ( "sideR: ", sideR );
  221. echo ( "divider: ", divider );
  222. echo ( "back: ", back );
  223.  
  224. echo ( "door_bottom_L: ", door_bottom_L );
  225. echo ( "door_bottom_R: ", door_bottom_R );
  226. echo ( "door_top_L: ", door_top_L );
  227. echo ( "door_top_R: ", door_top_R );
  228. echo ( "door_L_side_L: ", door_L_side_L );
  229. echo ( "door_L_side_R: ", door_L_side_R );
  230. echo ( "door_R_side_L: ", door_R_side_L );
  231. echo ( "door_R_side_R: ", door_R_side_R );
  232. echo ( "door_back_L: ", door_back_L );
  233. echo ( "door_back_R: ", door_back_R );
  234.  
  235. echo ( "middle_ws: ", middle_ws );
  236. echo ( "side_ws_L: ", side_ws_L );
  237. echo ( "side_ws_R: ", side_ws_R );
  238.  
Advertisement
Add Comment
Please, Sign In to add comment