-
Notifications
You must be signed in to change notification settings - Fork 194
/
gridfinity-rebuilt-bins.scad
196 lines (166 loc) · 7.07 KB
/
gridfinity-rebuilt-bins.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// ===== INFORMATION ===== //
/*
IMPORTANT: rendering will be better in development builds and not the official release of OpenSCAD, but it makes rendering only take a couple seconds, even for comically large bins.
the magnet holes can have an extra cut in them to make it easier to print without supports
tabs will automatically be disabled when gridz is less than 3, as the tabs take up too much space
base functions can be found in "gridfinity-rebuilt-utility.scad"
comments like ' //.5' after variables are intentional and used by the customizer
examples at end of file
#BIN HEIGHT
The original gridfinity bins had the overall height defined by 7mm increments.
A bin would be 7*u millimeters tall with a stacking lip at the top of the bin (4.4mm) added onto this height.
The stock bins have unit heights of 2, 3, and 6:
* Z unit 2 -> 7*2 + 4.4 -> 18.4mm
* Z unit 3 -> 7*3 + 4.4 -> 25.4mm
* Z unit 6 -> 7*6 + 4.4 -> 46.4mm
## Note:
The stacking lip provided here has a 0.6mm fillet instead of coming to a sharp point.
Which has a height of 3.55147mm instead of the specified 4.4mm.
This **has no impact on stacking height, and can be ignored.**
https://github.com/kennetek/gridfinity-rebuilt-openscad
*/
use <src/core/gridfinity-rebuilt-utility.scad>
use <src/core/gridfinity-rebuilt-holes.scad>
// ===== PARAMETERS ===== //
/* [Setup Parameters] */
$fa = 8;
$fs = 0.25; // .01
/* [General Settings] */
// number of bases along x-axis
gridx = 3; //.5
// number of bases along y-axis
gridy = 2; //.5
// bin height. See bin height information and "gridz_define" below.
gridz = 6; //.1
/* [Linear Compartments] */
// number of X Divisions (set to zero to have solid bin)
divx = 1;
// number of Y Divisions (set to zero to have solid bin)
divy = 1;
/* [Cylindrical Compartments] */
// number of cylindrical X Divisions (mutually exclusive to Linear Compartments)
cdivx = 0;
// number of cylindrical Y Divisions (mutually exclusive to Linear Compartments)
cdivy = 0;
// orientation
c_orientation = 2; // [0: x direction, 1: y direction, 2: z direction]
// diameter of cylindrical cut outs
cd = 10; // .1
// cylinder height
ch = 1; //.1
// spacing to lid
c_depth = 1;
// chamfer around the top rim of the holes
c_chamfer = 0.5; // .1
/* [Height] */
// determine what the variable "gridz" applies to based on your use case
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]
// overrides internal block height of bin (for solid containers). Leave zero for default height. Units: mm
height_internal = 0;
// snap gridz height to nearest 7mm increment
enable_zsnap = false;
/* [Features] */
// the type of tabs
style_tab = 1; //[0:Full,1:Auto,2:Left,3:Center,4:Right,5:None]
// which divisions have tabs
place_tab = 0; // [0:Everywhere-Normal,1:Top-Left Division]
// how should the top lip act
style_lip = 0; //[0: Regular lip, 1:remove lip subtractively, 2: remove lip and retain height]
// scoop weight percentage. 0 disables scoop, 1 is regular scoop. Any real number will scale the scoop.
scoop = 1; //[0:0.1:1]
/* [Base Hole Options] */
// only cut magnet/screw holes at the corners of the bin to save uneccesary print time
only_corners = false;
//Use gridfinity refined hole style. Not compatible with magnet_holes!
refined_holes = true;
// Base will have holes for 6mm Diameter x 2mm high magnets.
magnet_holes = false;
// Base will have holes for M3 screws.
screw_holes = false;
// Magnet holes will have crush ribs to hold the magnet.
crush_ribs = true;
// Magnet/Screw holes will have a chamfer to ease insertion.
chamfer_holes = true;
// Magnet/Screw holes will be printed so supports are not needed.
printable_hole_top = true;
// Enable "gridfinity-refined" thumbscrew hole in the center of each base: https://www.printables.com/model/413761-gridfinity-refined
enable_thumbscrew = false;
hole_options = bundle_hole_options(refined_holes, magnet_holes, screw_holes, crush_ribs, chamfer_holes, printable_hole_top);
// ===== IMPLEMENTATION ===== //
color("tomato") {
gridfinityInit(gridx, gridy, height(gridz, gridz_define, style_lip, enable_zsnap), height_internal, sl=style_lip) {
if (divx > 0 && divy > 0) {
cutEqual(n_divx = divx, n_divy = divy, style_tab = style_tab, scoop_weight = scoop, place_tab = place_tab);
} else if (cdivx > 0 && cdivy > 0) {
cutCylinders(n_divx=cdivx, n_divy=cdivy, cylinder_diameter=cd, cylinder_height=ch, coutout_depth=c_depth, orientation=c_orientation, chamfer=c_chamfer);
}
}
gridfinityBase([gridx, gridy], hole_options=hole_options, only_corners=only_corners, thumbscrew=enable_thumbscrew);
}
// ===== EXAMPLES ===== //
// 3x3 even spaced grid
/*
gridfinityInit(3, 3, height(6), 0, 42) {
cutEqual(n_divx = 3, n_divy = 3, style_tab = 0, scoop_weight = 0);
}
gridfinityBase([3, 3]);
*/
// 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.
/*
gridfinityInit(3, 3, height(6), 0, 42) {
cut(x=0, y=0, w=1.5, h=0.5, t=5, s=0);
cut(0, 0.5, 1.5, 0.5, 5, 0);
cut(0, 1, 1.5, 0.5, 5, 0);
cut(0,1.5,0.5,1.5,5,0);
cut(0.5,1.5,0.5,1.5,5,0);
cut(1,1.5,0.5,1.5,5,0);
cut(1.5, 0, 1.5, 5/3, 2);
cut(1.5, 5/3, 1.5, 4/3, 4);
}
gridfinityBase([3, 3]);
*/
// Compartments can overlap! This allows for weirdly shaped compartments, such as this "2" bin.
/*
gridfinityInit(3, 3, height(6), 0, 42) {
cut(0,2,2,1,5,0);
cut(1,0,1,3,5);
cut(1,0,2,1,5);
cut(0,0,1,2);
cut(2,1,1,2);
}
gridfinityBase(3, 3, 42, 0, 0, 1);
*/
// 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.
/*
gridfinityInit(3, 3, height(6), 0, 42) {
cut(x=0, y=0, w=2, h=3);
cut(x=0, y=0, w=3, h=1, t=5);
cut_move(x=2, y=1, w=1, h=2)
pattern_linear(x=1, y=3, sx=42/2)
cylinder(r=5, h=1000, center=true);
}
gridfinityBase([3, 3]);
*/
// 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
/*
gx = 3;
gy = 3;
gridfinityInit(gx, gy, height(6), 0, 42) {
for(i=[0:gx-1]) {
cut(i,0,1,gx-1);
cut(i,gx-1,1,1);
}
}
gridfinityBase([gx, gy]);
*/
// Pyramid scheme bin
/*
gx = 4;
gy = 4;
gridfinityInit(gx, gy, height(6), 0, 42) {
for (i = [0:gx-1])
for (j = [0:i])
cut(j*gx/(i+1),gy-i-1,gx/(i+1),1,0);
}
gridfinityBase([gx, gy]);
*/