-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
gridfinity_lid.scad
306 lines (285 loc) · 12.1 KB
/
gridfinity_lid.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
// Gridfinity extended basic cup
// version 2024-02-17
//
// Source
// https://www.printables.com/model/630057-gridfinity-extended-openscad
//
// Documentation
// https://docs.ostat.com/docs/openscad/gridfinity-extended/basic-cup.html
include <modules/gridfinity_constants.scad>
include <modules/module_gridfinity_sliding_lid.scad>
use <modules/module_gridfinity_cup.scad>
use <modules/module_gridfinity.scad>
/* [Sliding Lid] */
mode = "both";//[both, lid, cup]
sliding_lid_enabled = true;
// 0 = wall thickness *2
sliding_lid_thickness = 0; //0.1
// 0 = wall_thickness/2
sliding_min_wall_thickness = 0;//0.1
// 0 = default_sliding_lid_thickness/2
sliding_min_support = 0;//0.1
sliding_clearance = 0.1;//0.1
sliding_lid_cutout_enabled = false; //
sliding_lid_cutout_size = [0,0]; //0.1
sliding_lid_cutout_radius = 10; //0.1
sliding_lid_cutout_position = [0,0]; //0.1
/*<!!start gridfinity_basic_cup!!>*/
/* [General Cup] */
// X dimension. grid units (multiples of 42mm) or mm.
width = [2, 0]; //0.5
// Y dimension. grid units (multiples of 42mm) or mm.
depth = [1, 0]; //0.5
// Z dimension excluding. grid units (multiples of 7mm) or mm.
height = [3, 0]; //0.1
// Fill in solid block (overrides all following options)
filled_in = false;
// Wall thickness of outer walls. default, height < 8 0.95, height < 16 1.2, height > 16 1.6 (Zack's design is 0.95 mm)
wall_thickness = 0; // .01
// Remove some or all of lip
lip_style = "normal"; // [ normal, reduced, minimum, none:not stackable ]
position = "center"; //[default,center,zero]
//under size the bin top by this amount to allow for better stacking
zClearance = 0; // 0.1
/* [Subdivisions] */
chamber_wall_thickness = 1.2;
// X dimension subdivisions
vertical_chambers = 1;
vertical_separator_bend_position = 0;
vertical_separator_bend_angle = 0;
vertical_separator_bend_separation = 0;
vertical_separator_cut_depth=0;
horizontal_chambers = 1;
horizontal_separator_bend_position = 0;
horizontal_separator_bend_angle = 0;
horizontal_separator_bend_separation = 0;
horizontal_separator_cut_depth=0;
// Enable irregular subdivisions
vertical_irregular_subdivisions = false;
// Separator positions are defined in terms of grid units from the left end
vertical_separator_config = "10.5|21|42|50|60";
// Enable irregular subdivisions
horizontal_irregular_subdivisions = false;
// Separator positions are defined in terms of grid units from the left end
horizontal_separator_config = "10.5|21|42|50|60";
/* [Base] */
//size of magnet, diameter and height. Zacks original used 6.5 and 2.4
magnet_size = [6.5, 2.4]; // .1
//create relief for magnet removal
magnet_easy_release = "auto";//["off","auto","inner","outer"]
//size of screw, diameter and height. Zacks original used 3 and 6
screw_size = [3, 6]; // .1
//size of center magnet, diameter and height.
center_magnet_size = [0,0];
// Sequential Bridging hole overhang remedy is active only when both screws and magnets are nonzero (and this option is selected)
hole_overhang_remedy = 2;
//Only add attachments (magnets and screw) to box corners (prints faster).
box_corner_attachments_only = true;
// Minimum thickness above cutouts in base (Zack's design is effectively 1.2)
floor_thickness = 0.7;
cavity_floor_radius = -1;// .1
// Efficient floor option saves material and time, but the internal floor is not flat
efficient_floor = "off";//[off,on,rounded,smooth]
// Enable to subdivide bottom pads to allow half-cell offsets
half_pitch = false;
// Removes the internal grid from base the shape
flat_base = false;
// Remove floor to create a vertical spacer
spacer = false;
/* [Label] */
label_style = "normal"; //[disabled: no label, normal:normal, gflabel:gflabel basic label, pred:pred - labels by pred, cullenect:Cullenect click labels V2, cullenect_legacy:Cullenect click labels v1]
// Include overhang for labeling (and specify left/right/center justification)
label_position = "left"; // [left, right, center, leftchamber, rightchamber, centerchamber]
// Width, Depth, Height, Radius. Width in Gridfinity units of 42mm, Depth and Height in mm, radius in mm. Width of 0 uses full width. Height of 0 uses Depth, height of -1 uses depth*3/4.
label_size = [0,14,0,0.6]; // 0.01
// Size in mm of relief where appropiate. Width, depth, height, radius
label_relief = [0,0,0,0.6]; // 0.1
// wall to enable on, front, back, left, right. 0: disabled; 1: enabled;
label_walls=[0,1,0,0]; //[0:1:1]
/* [Finger Slide] */
// Include larger corner fillet
fingerslide = "none"; //[none, rounded, chamfered]
// Radius of the corner fillet
fingerslide_radius = 8;
/* [Tapered Corner] */
tapered_corner = "none"; //[none, rounded, chamfered]
tapered_corner_size = 10;
// Set back of the tapered corner, default is the gridfinity corner radius
tapered_setback = -1;//gridfinity_corner_radius/2;
/* [Wall Pattern] */
// Grid wall patter
wallpattern_enabled=false;
// Style of the pattern
wallpattern_style = "grid"; //[grid, hexgrid, voronoi,voronoigrid,voronoihexgrid]
// Spacing between pattern
wallpattern_hole_spacing = 2; //0.1
// wall to enable on, front, back, left, right.
wallpattern_walls=[1,1,1,1];
// Add the pattern to the dividers
wallpattern_dividers_enabled="disabled"; //[disabled, horizontal, vertical, both]
//Number of sides of the hole op
wallpattern_hole_sides = 6; //[4:square, 6:Hex, 64:circle]
//Size of the hole
wallpattern_hole_size = 10; //0.1
// pattern fill mode
wallpattern_fill = "none"; //[none, space, crop, crophorizontal, cropvertical, crophorizontal_spacevertical, cropvertical_spacehorizontal, spacevertical, spacehorizontal]
wallpattern_voronoi_noise = 0.75;
wallpattern_voronoi_radius = 0.5;
/* [Wall Cutout] */
wallcutout_vertical ="disabled"; //[disabled, enabled, wallsonly, frontonly, backonly]
// wall to enable on, front, back, left, right. 0: disabled; Positive: GF units; Negative: ratio length/abs(value)
wallcutout_vertical_position=-2; //0.1
//default will be binwidth/2
wallcutout_vertical_width=0;
wallcutout_vertical_angle=70;
//default will be binHeight
wallcutout_vertical_height=0;
wallcutout_vertical_corner_radius=5;
wallcutout_horizontal ="disabled"; //[disabled, enabled, wallsonly, leftonly, rightonly]
// wall to enable on, front, back, left, right. 0: disabled; Positive: GF units; Negative: ratio length/abs(value)
wallcutout_horizontal_position=-2; //0.1
//default will be binwidth/2
wallcutout_horizontal_width=0;
wallcutout_horizontal_angle=70;
//default will be binHeight
wallcutout_horizontal_height=0;
wallcutout_horizontal_corner_radius=5;
/* [Extendable] */
extension_x_enabled = "disabled"; //[disabled, front, back]
extension_x_position = 0.5;
extension_y_enabled = "disabled"; //[disabled, front, back]
extension_y_position = 0.5;
extension_tabs_enabled = true;
//Tab size, height, width, thickness, style. width default is height, thickness default is 1.4, style {0,1,2}.
extension_tab_size= [10,0,0,0];
/* [debug] */
//Slice along the x axis
cutx = 0; //0.1
//Slice along the y axis
cuty = 0; //0.1
// enable loging of help messages during render.
enable_help = false;
module end_of_customizer_opts() {}
/*<!!end gridfinity_basic_cup!!>*/
if(mode == "both" || mode == "cup")
{
gridfinity_cup(
width=width, depth=depth, height=height,
position=position,
filled_in=filled_in,
label_settings=LabelSettings(
labelStyle=label_style,
labelPosition=label_position,
labelSize=label_size,
labelRelief=label_relief,
labelWalls=label_walls),
fingerslide=fingerslide,
fingerslide_radius=fingerslide_radius,
cupbase_settings = CupBaseSettings(
magnetSize = magnet_size,
magnetEasyRelease = magnet_easy_release,
centerMagnetSize = center_magnet_size,
screwSize = screw_size,
holeOverhangRemedy = hole_overhang_remedy,
cornerAttachmentsOnly = box_corner_attachments_only,
floorThickness = floor_thickness,
cavityFloorRadius = cavity_floor_radius,
efficientFloor=efficient_floor,
halfPitch=half_pitch,
flatBase=flat_base,
spacer=spacer),
wall_thickness=wall_thickness,
chamber_wall_thickness=chamber_wall_thickness,
vertical_chambers = vertical_chambers,
vertical_separator_bend_position=vertical_separator_bend_position,
vertical_separator_bend_angle=vertical_separator_bend_angle,
vertical_separator_bend_separation=vertical_separator_bend_separation,
vertical_separator_cut_depth=vertical_separator_cut_depth,
vertical_irregular_subdivisions=vertical_irregular_subdivisions,
vertical_separator_config=vertical_separator_config,
horizontal_chambers=horizontal_chambers,
horizontal_separator_bend_position=horizontal_separator_bend_position,
horizontal_separator_bend_angle=horizontal_separator_bend_angle,
horizontal_separator_bend_separation=horizontal_separator_bend_separation,
horizontal_separator_cut_depth=horizontal_separator_cut_depth,
horizontal_irregular_subdivisions=horizontal_irregular_subdivisions,
horizontal_separator_config=horizontal_separator_config,
lip_style=lip_style,
zClearance=zClearance,
tapered_corner=tapered_corner,
tapered_corner_size = tapered_corner_size,
tapered_setback = tapered_setback,
wallpattern_enabled=wallpattern_enabled,
wallpattern_style=wallpattern_style,
wallpattern_walls=wallpattern_walls,
wallpattern_dividers_enabled=wallpattern_dividers_enabled,
wallpattern_hole_sides=wallpattern_hole_sides,
wallpattern_hole_size=wallpattern_hole_size,
wallpattern_hole_spacing=wallpattern_hole_spacing,
wallpattern_fill=wallpattern_fill,
wallpattern_voronoi_noise=wallpattern_voronoi_noise,
wallpattern_voronoi_radius = wallpattern_voronoi_radius,
wallcutout_vertical=wallcutout_vertical,
wallcutout_vertical_position=wallcutout_vertical_position,
wallcutout_vertical_width=wallcutout_vertical_width,
wallcutout_vertical_angle=wallcutout_vertical_angle,
wallcutout_vertical_height=wallcutout_vertical_height,
wallcutout_vertical_corner_radius=wallcutout_vertical_corner_radius,
wallcutout_horizontal=wallcutout_horizontal,
wallcutout_horizontal_position=wallcutout_horizontal_position,
wallcutout_horizontal_width=wallcutout_horizontal_width,
wallcutout_horizontal_angle=wallcutout_horizontal_angle,
wallcutout_horizontal_height=wallcutout_horizontal_height,
wallcutout_horizontal_corner_radius=wallcutout_horizontal_corner_radius,
extendable_Settings = ExtendableSettings(
extendablexEnabled = extension_x_enabled,
extendablexPosition = extension_x_position,
extendableyEnabled = extension_y_enabled,
extendableyPosition = extension_y_position,
extendableTabsEnabled = extension_tabs_enabled,
extendableTabSize = extension_tab_size),
sliding_lid_enabled = sliding_lid_enabled,
sliding_lid_thickness = sliding_lid_thickness,
sliding_min_wall_thickness = sliding_min_wall_thickness,
sliding_min_support = sliding_min_support,
sliding_clearance = sliding_clearance,
cutx=cutx,
cuty=cuty,
help = enable_help);
}
if(mode == "both" || mode == "lid")
{
num_x = calcDimensionWidth(width);
num_y = calcDimensionDepth(depth);
num_z = calcDimensionHeight(height);
wall_thickness = wallThickness(wall_thickness, num_z);
slidingLidSettings= SlidingLidSettings(
sliding_lid_enabled,
sliding_lid_thickness,
sliding_min_wall_thickness,
sliding_min_support,
sliding_clearance,
wall_thickness);
zClearance = zClearance + (sliding_lid_enabled ? slidingLidSettings[iSlidingLidThickness] : 0);
filledInZ = gf_zpitch*num_z;
zpoint = filledInZ-zClearance;
color(color_lid)
translate(cupPosition(position,num_x,num_y))
tz(mode == "lid"? 0 : zpoint)
difference()
{
SlidingLid(
num_x=num_x,
num_y=num_y,
wall_thickness,
clearance = slidingLidSettings[iSlidingClearance],
lidThickness=slidingLidSettings[iSlidingLidThickness],
lidMinSupport=slidingLidSettings[iSlidingLidMinSupport],
lidMinWallThickness=slidingLidSettings[iSlidingLidMinWallThickness],
limitHeight=true,
cutoutEnabled = true,
cutoutSize = sliding_lid_cutout_size,
cutoutRadius = sliding_lid_cutout_radius,
cutoutPosition = sliding_lid_cutout_position);
}
}