-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhoneycomb_grid.scad
211 lines (197 loc) · 5.94 KB
/
honeycomb_grid.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
/**
* Originally:
* Módulo que permite trabajar con patrones hexagonales tipo panal.
*
* @author Joaquín Fernández
* @url https://gitlab.com/joaquinfq/openscad/blob/master/Modules/Pattern/honeycomb.scad
* @license CC-BY-NC-4.0
* @see http://www.thingiverse.com/thing:2124344
* Modified by: John Flinchbaugh
* Added the sleeve, tabs, and a measurement-sized module.
*/
/**
* Dibuja un panal de miel completo.
*
* @param {Number} columns Número de columnas (Eje X).
* @param {Number} rows Número de filas (Eje Y).
* @param {Number} height Altura del cubo (Eje Z).
* @param {Number} size Tamaño del hexágono.
* @param {Number} thickness Grosor de las paredes del panal.
*/
module honeycomb(columns, rows, height, size, thickness)
{
_halfSize = size / 2;
for (_row = [ 0 : rows ]) {
translate([
(_row % 2) * _halfSize,
_row * _halfSize * sqrt(3),
0
]) {
for (_column = [0 : columns]) {
translate([ _column * size, 0, 0 ]) {
rotate([0, 0, 30]) {
cylinder(
r = (size - thickness) / sqrt(3),
h = height,
$fn = 6
);
}
}
}
}
}
}
/**
* Dibuja un panal acotado por un cubo hueco.
*
* @param {Number} columns Número de columnas (Eje X).
* @param {Number} rows Número de filas (Eje Y).
* @param {Number} height Altura del cubo (Eje Z).
* @param {Number} size Tamaño del hexágono.
* @param {Number} thickness Grosor de las paredes del panal.
*/
module honeycombCube(columns, rows, height, size, thickness, sleeve_thickness, slot_width) {
_width = (columns ) * size;
_length = (rows) * size * sqrt(3) / 2;
difference() {
// main body
translate([sleeve_thickness, sleeve_thickness, 0]) {
minkowski() {
cube([
_width + sleeve_thickness ,
_length - sleeve_thickness,
height + sleeve_thickness - 1]);
cylinder(r=sleeve_thickness, h = 1);
}
}
// carve out indent for sleeve
translate([
sleeve_thickness * 3,
sleeve_thickness * 3/2,
height
]) {
minkowski() {
cube([
_width - 3 * sleeve_thickness,
_length - 2 * sleeve_thickness,
sleeve_thickness - 1
]);
cylinder(r=sleeve_thickness/2, h = 1);
}
}
// carve out honey comb
intersection() {
translate([
sleeve_thickness * 3,
sleeve_thickness * 3/2,
0
]) {
minkowski() {
cube([
_width - 3 * sleeve_thickness,
_length - 2 * sleeve_thickness,
height
]);
cylinder(r=sleeve_thickness/2, h = 1);
}
}
translate([
sleeve_thickness,
sleeve_thickness / 2,
0
]) {
honeycomb(columns + 1, rows + 1, height, size, thickness);
}
}
// carve out slots
translate([
sleeve_thickness * 3/4,
(sleeve_thickness + _length - slot_width) / 2,
0
]) {
cube([
sleeve_thickness,
slot_width,
height + sleeve_thickness
]);
}
translate([
sleeve_thickness * 5/4 + _width,
(sleeve_thickness + _length - slot_width) / 2,
0
]) {
cube([
sleeve_thickness,
slot_width,
height + sleeve_thickness
]);
}
}
}
module honeycombCubeSize(
width,
length,
height,
size,
thickness,
sleeve_thickness,
slot_width
) {
columns = (width + sleeve_thickness * 2) / size;
rows = (length + sleeve_thickness* 2) / size / sqrt(3) * 2;
honeycombCube(
columns,
rows,
height,
size,
thickness,
sleeve_thickness,
slot_width
);
}
// 66 x 41 - YN-460II
//honeycombCubeSize(66, 42, 15, 6.6, 0.43, 1.6, 15);
sleeve_thickness = 3.0; // mm
tolerance = 0.4; //mm
strap_length = 50; // mm
// 77 x 49 - YN-560IV
// honeycombCubeSize(77, 49, 17, 6.6, 0.5, sleeve_thickness, 20);
// straps
module strap(strap_length, strap_width, sleeve_thickness, tolerance) {
difference() {
cube([
strap_width - 2 * tolerance,
strap_length,
sleeve_thickness - tolerance
]);
translate([sleeve_thickness, sleeve_thickness, 0]) {
cube([
strap_width - tolerance - 5 * sleeve_thickness,
strap_length - 2 * sleeve_thickness,
sleeve_thickness - tolerance
]);
}
translate([sleeve_thickness * 4 - tolerance, sleeve_thickness, 0]) {
cube([
strap_width - tolerance - 5 * sleeve_thickness,
strap_length - 2 * sleeve_thickness,
sleeve_thickness - tolerance
]);
}
translate([sleeve_thickness, sleeve_thickness, 0]) {
cube([
strap_width - 2 * tolerance - 2 * sleeve_thickness,
strap_length - 6 * sleeve_thickness,
sleeve_thickness - tolerance
]);
}
}
translate([-1 * sleeve_thickness, 0, 0]) {
cube([
strap_width + 2 * sleeve_thickness - tolerance * 2,
sleeve_thickness,
sleeve_thickness
]);
}
}
strap(strap_length, 20, sleeve_thickness, tolerance);