-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
gridfinity_vertical_divider.scad
269 lines (250 loc) · 8.88 KB
/
gridfinity_vertical_divider.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
include <modules/module_item_holder.scad>
include <modules/gridfinity_constants.scad>
include <modules/functions_general.scad>
use <modules/module_gridfinity_cup.scad>
use <modules/module_gridfinity.scad>
/* [Divider] */
divider_count = 4;
divider_height = 50;
divider_width = 3;
divider_base_height = 10;
divider_radius = 5;
divider_front_top_inset=20;
divider_front_top_angle=45;
divider_back_top_inset=20;
divider_back_top_angle=45;
/* [Wall Pattern] */
// Grid wall patter
wallpattern_enabled=true;
// Style of the pattern
wallpattern_style = "hexgrid"; //[grid, hexgrid, voronoi,voronoigrid,voronoihexgrid]
// Spacing between pattern
wallpattern_hole_spacing = 2; //0.1
//Number of sides of the hole op
wallpattern_hole_sides = 6; //[4:square, 6:Hex, 64:circle]
//Size of the hole
wallpattern_hole_size = 5; //0.1
// pattern fill mode
wallpattern_fill = "crop"; //[none, space, crop, crophorizontal, cropvertical, crophorizontal_spacevertical, cropvertical_spacehorizontal, spacevertical, spacehorizontal]
wallpattern_voronoi_noise = 0.75;
wallpattern_voronoi_radius = 0.5;
/* [General Cup] */
// X dimension. grid units (multiples of 42mm) or mm.
width = [3, 0]; //0.5
// Y dimension. grid units (multiples of 42mm) or mm.
depth = [2, 0]; //0.5
// Z dimension excluding. grid units (multiples of 7mm) or mm.
height = [1, 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]
/* [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;
/* [Hidden] */
enable_help = false;
module end_of_customizer_opts() {}
Gridfinity_Divider();
module Divider(
height = 50,
length = 100,
baseHeight = 10,
radius = 5,
frontTopInset=20,
frontTopAngle=65,
backTopInset=20,
backTopAngle=65,
$fn = 36
){
_baseHeight = radius > baseHeight ? radius : baseHeight;
_backBottomHeight = max(_baseHeight,height-radius-abs(backTopInset*tan(backTopAngle)));
_frontBottomHeight = max(_baseHeight,height-radius-abs(frontTopInset*tan(frontTopAngle)));
if(IsHelpEnabled("debug")) echo("Gridfinity_Divider", height,radius, abs(backTopInset*tan(backTopAngle)),_backBottomHeight);
if(IsHelpEnabled("debug")) echo("Gridfinity_Divider", _baseHeight=_baseHeight, height=height, _backBottomHeight=_backBottomHeight, _frontBottomHeight=_frontBottomHeight);
positions = [
[radius,_frontBottomHeight], //front bottom
[radius+frontTopInset,height-radius], //front top
[length-radius-backTopInset,height-radius], //back top
[length-radius,_backBottomHeight] //back bottom
];
//
hull(){
square([length,_baseHeight]);
for(index =[0:1:len(positions)-1])
{
translate(positions[index])
circle(r=radius, $fn=$fn);
}
}
}
module PatternedDivider(
height = 50,
length = 100,
baseHeight = 10,
width = 5,
radius = 5,
frontTopInset=20,
frontTopAngle=65,
backTopInset=20,
backTopAngle=65,
wallpatternEnabled = wallpattern_enabled,
wallpatternStyle = wallpattern_style,
wallpatternHoleSpacing = wallpattern_hole_spacing,
wallpatternHoleSides = wallpattern_hole_sides,
wallpatternHoleSize = wallpattern_hole_size,
wallpatternFill = wallpattern_fill,
wallpatternVoronoiNoise = wallpattern_voronoi_noise,
wallpatternVoronoiRadius = wallpattern_voronoi_radius,
help= false,
$fn = 36){
rotate([90,0,0])
difference(){
linear_extrude(height = width)
Divider(
height = height,
length = length,
baseHeight = baseHeight,
radius = radius,
frontTopInset=frontTopInset,
frontTopAngle=frontTopAngle,
backTopInset=backTopInset,
backTopAngle=backTopAngle,
$fn = $fn);
if(wallpatternEnabled){
translate([0,0,-fudgeFactor])
intersection(){
linear_extrude(height = width+fudgeFactor*2)
offset(delta = -width)
Divider(
height = height,
length = length,
baseHeight = baseHeight,
radius = radius,
frontTopInset=frontTopInset,
frontTopAngle=frontTopAngle,
backTopInset=backTopInset,
backTopAngle=backTopAngle,
$fn = $fn);
translate([0,height+baseHeight,0])
rotate([0,0,-90])
cutout_pattern(
patternStyle = wallpatternStyle ,
canvasSize = [height+baseHeight,length], //Swap x and y and rotate so hex is easier to print
customShape = false,
circleFn = wallpatternHoleSides,
holeSize = [wallpatternHoleSize, wallpatternHoleSize],
holeSpacing = [wallpattern_hole_spacing,wallpattern_hole_spacing],
holeHeight = width*2,
center=false,
fill=wallpatternFill, //"none", "space", "crop"
voronoiNoise=wallpatternVoronoiNoise,
voronoiRadius = wallpatternVoronoiRadius,
help=help);
}
}
}
}
module Gridfinity_Divider(
width=width, depth=depth, height=height,
position=position,
filled_in=filled_in,
magnet_diameter=magnet_diameter,
magnet_easy_release=magnet_easy_release,
screw_depth=screw_depth,
floor_thickness=floor_thickness,
wall_thickness=wall_thickness,
hole_overhang_remedy=hole_overhang_remedy,
half_pitch=half_pitch,
lip_style=lip_style,
box_corner_attachments_only=box_corner_attachments_only,
flat_base=flat_base,
dividercount=divider_count,
dividerheight=divider_height,
baseHeight=divider_base_height,
dividerwidth=divider_width,
radius=divider_radius,
frontTopInset=divider_front_top_inset,
frontTopAngle=divider_front_top_angle,
backTopInset=divider_back_top_inset,
backTopAngle=divider_back_top_angle,
wallpatternEnabled=wallpattern_enabled,
wallpatternStyle=wallpattern_style,
wallpatternHoleSpacing=wallpattern_hole_spacing,
wallpatternHoleSides=wallpattern_hole_sides,
wallpatternHoleSize=wallpattern_hole_size,
wallpatternFill=wallpattern_fill,
wallpatternVoronoiNoise=wallpattern_voronoi_noise,
wallpatternVoronoiRadius=wallpattern_voronoi_radius
){
num_x = calcDimensionWidth(width);
num_y = calcDimensionDepth(depth);
num_z = calcDimensionHeight(height);
floorHeight = calculateFloorHeight(magnet_size[1], screw_size[1], floor_thickness);
gridfinity_cup(
width=width, depth=depth, height=height,
position=position,
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,
lip_style=lip_style,
label_settings=LabelSettings(
labelStyle="disabled"),
help = enable_help);
for(i = [0 : divider_count-1]){
ypos = (num_y*gf_pitch-gf_cup_corner_radius*2-dividerwidth)/(divider_count-1)*i;
translate(cupPosition(position,num_x,num_y))
translate([0.25,gf_cup_corner_radius+dividerwidth+ypos,floorHeight])
PatternedDivider(
height = dividerheight,
length = num_x*gf_pitch-0.5,
baseHeight = baseHeight,
width = dividerwidth,
radius = radius,
frontTopInset=frontTopInset,
frontTopAngle=frontTopAngle,
backTopInset=backTopInset,
backTopAngle=backTopAngle,
wallpatternEnabled = wallpatternEnabled,
wallpatternStyle = wallpatternStyle,
wallpatternHoleSpacing = wallpatternHoleSpacing,
wallpatternHoleSides = wallpatternHoleSides,
wallpatternHoleSize = wallpatternHoleSize,
wallpatternFill = wallpatternFill,
wallpatternVoronoiNoise = wallpatternVoronoiNoise,
wallpatternVoronoiRadius = wallpatternVoronoiRadius);
}
}