forked from mrWheel/YAPP_Box
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathESP32-CAM.scad
254 lines (224 loc) · 7.09 KB
/
ESP32-CAM.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
//---------------------------------------------------------
// Yet Another Parameterized Projectbox generator
//
// This is a box for ESP32-CAM
//
// Version 1.0 (13-02-2022)
//
// This design is parameterized based on the size of a PCB.
//---------------------------------------------------------
include <./library/YAPPgenerator_v14.scad>
// Note: length/lengte refers to X axis,
// width/breedte to Y,
// height/hoogte to Z
/*
padding-back|<------pcb length --->|<padding-front
RIGHT
0 X-as --->
+----------------------------------------+ ---
| | ^
| | padding-right
| | v
| -5,y +----------------------+ | ---
B Y | | 0,y x,y | | ^ F
A - | | | | | R
C a | | | | | pcb width O
K s | | | | | N
| | 0,0 x,0 | | v T
^ | -5,0 +----------------------+ | ---
| | | padding-left
0 +----------------------------------------+ ---
0 X-as --->
LEFT
*/
printBaseShell = true;
printLidShell = true;
// Edit these parameters for your own board dimensions
wallThickness = 2.0;
basePlaneThickness = 2.0;
lidPlaneThickness = 2.0;
baseWallHeight = 12;
lidWallHeight = 6;
// Total height of box = basePlaneThickness + lidPlaneThickness
// + baseWallHeight + lidWallHeight
pcbLength = 40;
pcbWidth = 27.5;
pcbThickness = 1.5;
// padding between pcb and inside wall
paddingFront = 0.3;
paddingBack = 0.3;
paddingRight = 0.3;
paddingLeft = 0.3;
// ridge where base and lid off box can overlap
// Make sure this isn't less than lidWallHeight
ridgeHeight = 3;
ridgeSlack = 0.2;
roundRadius = 2.0;
// How much the PCB needs to be raised from the base
// to leave room for solderings and whatnot
standoffHeight = 11.0;
pinDiameter = 0.5;
pinHoleSlack = 0.1;
standoffDiameter = 3.5;
//-- D E B U G -------------------
showSideBySide = true;
hideLidWalls = false;
onLidGap = 6;
shiftLid = 10;
colorLid = "yellow";
hideBaseWalls = false;
colorBase = "white";
showPCB = false;
showMarkers = true;
inspectX = 0; // 0=none, >0 from front, <0 from back
inspectY = 0; // 0=none, >0 from left, <0 from right
//-- pcb_standoffs -- origin is pcb[0,0,0]
// (0) = posx
// (1) = posy
// (2) = { yappBoth | yappLidOnly | yappBaseOnly }
// (3) = { yappHole, YappPin }
pcbStands = [
[1, 1, yappBoth, yappHole]
,[1, pcbWidth-1, yappBoth, yappHole]
,[pcbLength-1, 1, yappBoth, yappHole]
,[pcbLength-1, pcbWidth-1, yappBoth, yappHole]
];
//-- Lid plane -- origin is pcb[0,0,0]
// (0) = posx
// (1) = posy
// (2) = width
// (3) = length
// (4) = angle
// (5) = { yappRectangle | yappCircle }
// (6) = { yappCenter }
cutoutsLid = [
[8, ((pcbWidth/2)+0.5), 9, 20, 0, yappCircle] // lens
, [9, ((pcbWidth/2)+0.5), 9, 20, 0, yappCircle] // lens
, [10, ((pcbWidth/2)+0.5), 9, 20, 0, yappCircle] // lens
, [30, pcbWidth-3, 6, 6, 0, yappRectangle, yappCenter] // flash LED
];
//-- base plane -- origin is pcb[0,0,0]
// (0) = posx
// (1) = posy
// (2) = width
// (3) = length
// (4) = angle
// (5) = { yappRectangle | yappCircle }
// (6) = { yappCenter }
cutoutsBase = [
[13, (pcbWidth/2)-7, 6, 1.5, 25, yappRectangle]
, [17, (pcbWidth/2)-7, 15, 1.5, 25, yappRectangle]
, [21, (pcbWidth/2)-7, 15, 1.5, 25, yappRectangle]
, [25, (pcbWidth/2)-7, 15, 1.5, 25, yappRectangle]
, [29, (pcbWidth/2)-7, 15, 1.5, 25, yappRectangle]
, [29, (pcbWidth/2)+0, 6, 1.5, 25, yappRectangle]
];
//-- front plane -- origin is pcb[0,0,0]
// (0) = posy
// (1) = posz
// (2) = width
// (3) = height
// (4) = angle
// (5) = { yappRectangle | yappCircle }
// (6) = { yappCenter }
cutoutsFront = [
];
//-- back plane -- origin is pcb[0,0,0]
// (0) = posy
// (1) = posz
// (2) = width
// (3) = height
// (4) = angle
// (5) = { yappRectangle | yappCircle }
// (6) = { yappCenter }
cutoutsBack = [
[13, 0, 15, 6, 0, yappRectangle, yappCenter] // SD card
];
//-- left plane -- origin is pcb[0,0,0]
// (0) = posx
// (1) = posz
// (2) = width
// (3) = height
// (4) = angle
// (5) = { yappRectangle | yappCircle }
// (6) = { yappCenter }
cutoutsLeft = [
];
//-- right plane -- origin is pcb[0,0,0]
// (0) = posx
// (1) = posz
// (2) = width
// (3) = height
// (4) = angle
// (5) = { yappRectangle | yappCircle }
// (6) = { yappCenter }
cutoutsRight = [
[shellLength-13, -7, 4, 6.5, 0, yappRectangle] // power cord
];
//-- connectors -- origen = box[0,0,0]
// (0) = posx
// (1) = posy
// (2) = screwDiameter
// (3) = insertDiameter
// (4) = outsideDiameter
// (5) = { yappAllCorners }
connectors = [
// [8, 8, 2.5, 3.8, 5, yappAllCorners]
// , [30, 8, 5, 5, 5]
];
//-- base mounts -- origen = box[x0,y0]
// (0) = posx | posy
// (1) = screwDiameter
// (2) = width
// (3) = height
// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)
// (5) = { yappCenter }
baseMounts = [
];
//-- snap Joins -- origen = box[x0,y0]
// (0) = posx | posy
// (1) = width
// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more)
// (n) = { yappSymmetric }
snapJoins = [
[2, 5, yappLeft, yappRight]
, [(shellWidth/2)-2.5, 5, yappFront]
];
//-- origin of labels is box [0,0,0]
// (0) = posx
// (1) = posy/z
// (2) = orientation
// (3) = plane {lid | base | left | right | front | back }
// (4) = font
// (5) = size
// (6) = "label text"
labelsPlane = [
];
module baseHookOutside()
{
translate([(shellLength/2)-7.5,shellWidth-wallThickness,1])
{
difference()
{
union()
{
cube([15,10,10]);
translate([0,10,5])
rotate([0,90,0])
cylinder(d=10, h=15);
}
translate([-1,10,5])
{
rotate([0,90,0])
color("red") cylinder(d=4.5, h=17);
}
translate([4.8,0,-0.5])
cube([5.4,16,11]);
}
} // translate
} // baseHook()
module lidHook()
{
} // lidHook()
//---- This is where the magic happens ----
YAPPgenerate();