Advertisement
Guest User

gridfinity

a guest
Jul 29th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.96 KB | None | 0 0
  1. include <gridfinity-rebuilt-utility.scad>
  2.  
  3. // ===== INFORMATION ===== //
  4. /*
  5. IMPORTANT: rendering will be better for analyzing the model if fast-csg is enabled. As of writing, this feature is only available in the development builds and not the official release of OpenSCAD, but it makes rendering only take a couple seconds, even for comically large bins. Enable it in Edit > Preferences > Features > fast-csg
  6. the magnet holes can have an extra cut in them to make it easier to print without supports
  7. tabs will automatically be disabled when gridz is less than 3, as the tabs take up too much space
  8. base functions can be found in "gridfinity-rebuilt-utility.scad"
  9. examples at end of file
  10.  
  11. BIN HEIGHT
  12. the original gridfinity bins had the overall height defined by 7mm increments
  13. a bin would be 7*u millimeters tall
  14. the lip at the top of the bin (3.8mm) added onto this height
  15. The stock bins have unit heights of 2, 3, and 6:
  16. Z unit 2 -> 7*2 + 3.8 -> 17.8mm
  17. Z unit 3 -> 7*3 + 3.8 -> 24.8mm
  18. Z unit 6 -> 7*6 + 3.8 -> 45.8mm
  19.  
  20. https://github.com/kennetek/gridfinity-rebuilt-openscad
  21.  
  22. */
  23.  
  24. // ===== PARAMETERS ===== //
  25.  
  26. /* [Setup Parameters] */
  27. $fa = 8;
  28. $fs = 0.25;
  29.  
  30. /* [General Settings] */
  31. // number of bases along x-axis
  32. gridx = 4;
  33. // number of bases along y-axis
  34. gridy = 1;
  35. // bin height. See bin height information and "gridz_define" below.
  36. gridz = 6;
  37.  
  38. /* [Compartments] */
  39. // number of X Divisions (set to zero to have solid bin)
  40. divx = 4;
  41. // number of y Divisions (set to zero to have solid bin)
  42. divy = 1;
  43.  
  44. /* [Height] */
  45. // determine what the variable "gridz" applies to based on your use case
  46. gridz_define = 0; // [0:gridz is the height of bins in units of 7mm increments - Zack's method,1:gridz is the internal height in millimeters, 2:gridz is the overall external height of the bin in millimeters]
  47. // overrides internal block height of bin (for solid containers). Leave zero for default height. Units: mm
  48. height_internal = 0;
  49. // snap gridz height to nearest 7mm increment
  50. enable_zsnap = false;
  51.  
  52. /* [Features] */
  53. // the type of tabs
  54. style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
  55. // how should the top lip act
  56. style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
  57. // scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
  58. scoop = 1; //[0:0.1:1]
  59. // only cut magnet/screw holes at the corners of the bin to save uneccesary print time
  60. only_corners = false;
  61.  
  62. /* [Base] */
  63. style_hole = 0; // [0:no holes, 1:magnet holes only, 2: magnet and screw holes - no printable slit, 3: magnet and screw holes - printable slit]
  64. // number of divisions per 1 unit of base along the X axis. (default 1, only use integers. 0 means automatically guess the right division)
  65. div_base_x = 0;
  66. // number of divisions per 1 unit of base along the Y axis. (default 1, only use integers. 0 means automatically guess the right division)
  67. div_base_y = 0;
  68.  
  69.  
  70.  
  71. // ===== IMPLEMENTATION ===== //
  72.  
  73. color("tomato") {
  74. /*
  75. gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), height_internal) {
  76.  
  77. if (divx > 0 && divy > 0)
  78. cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop);
  79. }
  80. gridfinityBase(gridx, gridy, l_grid, div_base_x, div_base_y, style_hole, only_corners=only_corners);
  81. */
  82. }
  83.  
  84.  
  85. // ===== EXAMPLES ===== //
  86.  
  87. // 3x3 even spaced grid
  88. /*
  89. gridfinityInit(3, 3, height(6), 0, 42) {
  90. cutEqual(n_divx = 3, n_divy = 3, style_tab = 0, scoop_weight = 0);
  91. }
  92. gridfinityBase(3, 3, 42, 0, 0, 1);
  93. */
  94.  
  95. // Compartments can be placed anywhere (this includes non-integer positions like 1/2 or 1/3). The grid is defined as (0,0) being the bottom left corner of the bin, with each unit being 1 base long. Each cut() module is a compartment, with the first four values defining the area that should be made into a compartment (X coord, Y coord, width, and height). These values should all be positive. t is the tab style of the compartment (0:full, 1:auto, 2:left, 3:center, 4:right, 5:none). s is a toggle for the bottom scoop.
  96. /*
  97. gridfinityInit(3, 3, height(6), 0, 42) {
  98. cut(x=0, y=0, w=1.5, h=0.5, t=5, s=0);
  99. cut(0, 0.5, 1.5, 0.5, 5, 0);
  100. cut(0, 1, 1.5, 0.5, 5, 0);
  101.  
  102. cut(0,1.5,0.5,1.5,5,0);
  103. cut(0.5,1.5,0.5,1.5,5,0);
  104. cut(1,1.5,0.5,1.5,5,0);
  105.  
  106. cut(1.5, 0, 1.5, 5/3, 2);
  107. cut(1.5, 5/3, 1.5, 4/3, 4);
  108. }
  109. gridfinityBase(3, 3, 42, 0, 0, 1);
  110. */
  111.  
  112. // Compartments can overlap! This allows for weirdly shaped compartments, such as this "2" bin.
  113. /*
  114. gridfinityInit(3, 3, height(6), 0, 42) {
  115. cut(0,2,2,1,5,0);
  116. cut(1,0,1,3,5);
  117. cut(1,0,2,1,5);
  118. cut(0,0,1,2);
  119. cut(2,1,1,2);
  120. }
  121. gridfinityBase(3, 3, 42, 0, 0, 1);
  122. */
  123.  
  124. // Areas without a compartment are solid material, where you can put your own cutout shapes. using the cut_move() function, you can select an area, and any child shapes will be moved from the origin to the center of that area, and subtracted from the block. For example, a pattern of three cylinderical holes.
  125. /*
  126. gridfinityInit(1, 2, height(6), 0, 42) {
  127.  
  128. cut_move(x=2.4, y=0, w=1, h=5)
  129. pattern_linear(x=1, y=4, sx=42/3)
  130. cylinder(r=5, h=1000, center=true);
  131.  
  132. cut_move(x=1.6, y=0, w=1, h=5)
  133. pattern_linear(x=1, y=4, sx=42/3)
  134. cube([10,10,1000], center=true);
  135. }
  136. gridfinityBase(1, 2, 42, 0, 0, 1);
  137. */
  138.  
  139. //PEN Bins
  140. gridfinityInit(1, 2, height(6), 0, 42) {
  141.  
  142. //cutmove x = left to right, y = top to bottom
  143.  
  144. // 2x2 grid of cylinders at the back r = 5.8mm
  145. cut_move(x=2, y=.98, w=1, h=1)
  146. pattern_linear(x=2, y=1.8, sx=47/3)
  147. cylinder(r=5.8, h=1000, center=true);
  148.  
  149.  
  150. // 1x2 row of cylinders in the middle - normal sharpie
  151. cut_move(x=2, y=.46, w=1, h=1)
  152. pattern_linear(x=2, y=1, sx=47/3)
  153. cylinder(r=6.2, h=1000, center=true);
  154.  
  155. // 1x 2 grid of cubes in front of the cylinders pen type a
  156. cut_move(x=2, y=0.08, w=1, h=1)
  157. pattern_linear(x=2, y=1, sx=47/3)
  158. cube([13,13,1000], center=true);
  159.  
  160.  
  161. // One row of 2 half-depth cubes in front of the above cubes pen type c
  162. cut_move(x=2, y=0, w=1, h=0.5)
  163. pattern_linear(x=2, y=1, sx=18)
  164. cube([16,4.5,1000], center=true);
  165.  
  166. }
  167.  
  168. gridfinityBase(1, 2, 42, 0, 0, 1);
  169.  
  170.  
  171. // You can use loops as well as the bin dimensions to make different parametric functions, such as this one, which divides the box into columns, with a small 1x1 top compartment and a long vertical compartment below
  172. /*
  173. gx = 3;
  174. gy = 3;
  175. gridfinityInit(gx, gy, height(6), 0, 42) {
  176. for(i=[0:gx-1]) {
  177. cut(i,0,1,gx-1);
  178. cut(i,gx-1,1,1);
  179. }
  180. }
  181. gridfinityBase(gx, gy, 42, 0, 0, 1);
  182. */
  183.  
  184. // Pyramid scheme bin
  185. /*
  186. gx = 4.5;
  187. gy = 4;
  188. gridfinityInit(gx, gy, height(6), 0, 42) {
  189. for (i = [0:gx-1])
  190. for (j = [0:i])
  191. cut(j*gx/(i+1),gy-i-1,gx/(i+1),1,0);
  192. }
  193. gridfinityBase(gx, gy, 42, 0, 0, 1);
  194. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement