-
Notifications
You must be signed in to change notification settings - Fork 5
/
andimoto6061.scad
416 lines (346 loc) · 11.9 KB
/
andimoto6061.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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
/* andimoto6061.scad
Author: [email protected]
----------------------------
for placing assambled parts and
single parts go to end of this file
this file is a template which may be copied to create a new keyboard layout
and to configure and place essential parts like usb cut out, screw holes or stabilizers
this file includes KeyV2 files. see https://github.com/rsheldiii/KeyV2
if you don't want this file to be included, just don't clone this library or
set the 'DoKeycapSimulation' parameter of KeyboardSim() to false.
*/
/* ########## predefinitions ############ */
$fn=30;
/* Thickness of entire plate which holds the switches.
* this is the top of the keyboard
*/
plateThickness=3;
/* thickness of the walls */
wallThickness=3;
/* height of the case */
caseHeight=13;
/* space between inner case stabilizers
and the bottom/lip of the case */
innerCaseSpace = 5;
//length, in units, of board
width=15;
//Height, in units, of board
height=5;
/* thickness of the lid.
the function 'lid()' will add an
extra mm to get a step for the lip
see 'innerExtraLid' variable in constants */
lidThickness=3;
/* ########## variables for cutting keyboard into smaller pieces ########## */
/* these are unit values; one unit is one key or switchhole
* this makes the keyboard printable on nearly every printer.
*/
cutAfterUnits = 6.5;
spacebarCut = 2.5;
/* fRowSeparator [true/false]
* Select separation of F-Row (or Row 0; key[0][1]=0)
* This will move the upper row by a half unit (lkey*0.5)
*/
fRowSeparator=false;
/* skirt selctor and skirt settings
* select 'skirtSelect' as true to activate a additional skirt
* around the keyboard case. The variables 'skirtX' & 'skirtY'
* are configurable as you want the skirt. These values ADD the
* configured amount to the side of the case.
* Note: be careful here, this interacts with caseRadius
*
* If this is activated you can call 'capFrame()'
* (or capFrameR/capFrameL) to create a nice frame
* around the keycaps to cover the switches. This may give
* a cleaner look if this is prefered.
*/
skirtSelect = false;
skirtX = 0;
skirtY = 0;
/* enables screw holes in frame (if capFrame() is called)
and in the case. The screws will be placed according to
the array frameScrewHoleArray[] around the case and frame.
*/
frameScrewsEnable = false;
/* edge radius of the case
* Note: be careful here, this interacts with skirtX/Y
* THIS IS ONLY VALID WHEN 'skirtSelect' IS TRUE
*/
caseRadius=10;
/* ################## calculated vars #################### */
/* debug extra for avoiding artefacts @ compilation */
extra=1;
/* add or reduce some tolerance for the switch holes.
* depends on your printers resolution and if you want
* narrow or loose fit of switches. do not configure to
* narrow switch holes. when placing switches into the holes
* they will pull the case apart and bend it. this will normally
* be reduced by the lid, but do not overact this.
*/
switchHoleTolerance = -0.2;
/* ############################################## */
/* ########## LAYOUT AND KEYCAP COLORS ########## */
/* ############################################## */
/* Usage: [[column place, row place],keycap unit, color for keycap simulation] */
/* "column place" is the place of the switch hole in the column;
- example: Esc, F1, F2, F3, ...
0 1 2 3 ...
"row place" is the place of the switch in the row;
- example: Esc, accent, TAB, CapsLock, ...
*/
/* ansiUS_6061 */
layout = [
//start ROW 1
[[0,0],1,"White"], //'
[[1,0],1,"MintCream"], //1
[[2,0],1,"MintCream"], //2
[[3,0],1,"MintCream"], //3
[[4,0],1,"MintCream"], //4
[[5,0],1,"MintCream"], //5
[[6,0],1,"MintCream"], //6
[[7,0],1,"MintCream"], //7
[[8,0],1,"MintCream"], //8
[[9,0],1,"MintCream"], //9
[[10,0],1,"MintCream"], //0
[[11,0],1,"MintCream"], //-_
[[12,0],1,"MintCream"], //=+
[[13,0],2,"White"], //backspace
//start ROW 2
[[ 0,1],1.5,"Grey"], //TAB
[[1.5,1],1,"MintCream"], //Q
[[2.5,1],1,"MintCream"], //W
[[3.5,1],1,"MintCream"], //E
[[4.5,1],1,"MintCream"], //R
[[5.5,1],1,"MintCream"], //T
[[6.5,1],1,"MintCream"], //Y
[[7.5,1],1,"MintCream"], //U
[[8.5,1],1,"MintCream"], //I
[[9.5,1],1,"MintCream"], //O
[[10.5,1],1,"MintCream"], //P
[[11.5,1],1,"MintCream"], //[
[[12.5,1],1,"MintCream"], //]
[[13.5,1],1.5,"Grey"], // \
//start ROW 3
[[ 0,2],1.75,"Grey"], //CapsLock
[[ 1.75,2],1,"MintCream"], //A
[[ 2.75,2],1,"MintCream"], //S
[[ 3.75,2],1,"MintCream"], //D
[[ 4.75,2],1,"MintCream"], //F
[[ 5.75,2],1,"MintCream"], //G
[[ 6.75,2],1,"MintCream"], //H
[[ 7.75,2],1,"MintCream"], //J
[[ 8.75,2],1,"MintCream"], //K
[[ 9.75,2],1,"MintCream"], //L
[[10.75,2],1,"MintCream"], //;
[[11.75,2],1,"MintCream"], //'
[[12.75,2],2.25,"Grey"], //ENTER
//start ROW 4
[[ 0,3],2.25,"Grey"], //LShift
[[ 2.25,3],1,"MintCream"], //Z
[[ 3.25,3],1,"MintCream"], //X
[[ 4.25,3],1,"MintCream"], //C
[[ 5.25,3],1,"MintCream"], //V
[[ 6.25,3],1,"MintCream"], //B
[[ 7.25,3],1,"MintCream"], //N
[[ 8.25,3],1,"MintCream"], //M
[[ 9.25,3],1,"MintCream"], //,
[[10.25,3],1,"MintCream"], //.
[[11.25,3],1,"MintCream"], // /
[[12.25,3],2.75,"Grey"], //RShift
//start ROW 5
[[ 0,4],1.25,"Grey"], //LCTRL
[[1.25,4],1.25,"Grey"], //TUX
[[2.5 ,4],1.25,"Grey"], //ALT
[[3.75,4],6.25,"White"], //SPACE
[[10 ,4],1.25,"Grey"], //COMP
[[11.25,4],1.25,"Grey"], //Fn
[[12.5 ,4],1.25,"Grey"], //RCTRL
[[13.75 ,4],1.25,"Grey"], //RCTRL
];
/* enable placment of stabilizers on switchholes with x.5 unit in y direction
* for example: true for numpad enter or numpad +
* if you just want a single unit (1unit keycap) you can set this to false */
enableStabsOnHalfs = true;
/* move pcb and usb cutout in x direction
for better placement */
pcbShift=0;
/* cutout for micro usb plug (not the housing of the usb plug!)
* change this if using mini usb
*/
usbCutX=8;
usbCutY=wallThickness;
/* Arduino Pro Micro USB Port height */
usbCutZ=3.4;
/* Teensy2 USB Port height */
/* usbCutZ=4.5; */
/* space in lid for placing the controller pcb.
* this example is for arduino pro micro clones.
* if you use teensy2.0 or something else configure
* the size of the controller pcb you use. the function
* 'pcbCutout()' will add 1mm to 'pcbWidth' for some clearance.
* pcbLength should be as exactly as possible. this keeps the pcb
* perfectly even if pcbWidth is to much
*/
/* teensy2 cutout */
pcbHeight = 1.8;
pcbWidth = 18.5;
pcbLength = 31.4;
/* arduino pro micro cutout */
//pcbHeight = 2;
//pcbWidth = 18;
//pcbLength = 34;
/* set 'addRisers' to true or false
* to calculate a lid with holes for risers
* and add risers to simulation
*/
addRisers = true;
/* keyboardRiser config
* angleBaseX -> width of the riser
* angleBaseY -> depth of the riser
*/
angleBaseY=80;
angleBaseX=60;
/* riser edge radius */
angleBaseRad=1;
/* polygon; this is the shape of the riser */
riserPoints = [
[0,0],
[angleBaseY,0],
[angleBaseY,3],
[0,16]
];
/* optional: move keyboard risers as needed */
xRiserR=0;
xRiserL=0;
yRiserAll=0;
riserConnectorRadius = 5;
riserConnectorX = 0;
riserConnectorY1 = 50;
/* ####### include keyboard lib ############ */
include <constants.scad>
include <keyboardParts.scad>
/* this module gets called in 'holematrix' and adds a specific
* object to the 'holematrix'. it enables placing switchholes
* or other cutout objects to the model */
module extraCutoutHook()
{
}
/* this module gets called in 'keycapMatrix()' and adds a specific
* object to the keycapMatrix. keycapMatrix is needed as a cutout element
* from the frame. this hook gives possibility to add more elements such
* as the enter keycap.
*/
module extraKeycapCutoutHook()
{
}
/* this module gets called in 'keySim()' and adds a specific
* object to the 'key simulation'. it enables placing keys
* or other objects to the model simulation */
module extraKeySimHook()
{
}
/* ####### screw hole config ######## */
/* set the screw holes to a good position.
* if your keyboard is bigger, you can add some
* more screw holes into the keyboard case and lid.
*/
screwHoleArray = [
[26,lkey-0.5], //left lower row
[114,lkey-0.5],
[170,lkey-0.5],
[260,lkey-0.5], // right lower row
[26,lkey*2+wallThickness-3], //left upper row
[110,lkey*2+wallThickness-3],
[171,lkey*2+wallThickness-3],
[256,lkey*2+wallThickness-3], //right upper row
[26,lkey*3+wallThickness-3], //left upper row
[110,lkey*3+wallThickness-3],
[171,lkey*3+wallThickness-3],
[256,lkey*3+wallThickness-3], //right upper row
[26,lkey*4+wallThickness-3], //left upper row
[114,lkey*4+wallThickness-3],
[171,lkey*4+wallThickness-3],
[256,lkey*4+wallThickness-3], //right upper row
];
/* rotate screw hole spacers */
screwSpacerRotation=0;
/* move horizontal case stabilizers inside the case.
* to move horizontal by lkey/2 for half switch cutout.
* this enables to set x.5 values in layout array.
* else use 0!!
*/
caseStabMov=0;
/* screw holes when enabling outer case frame */
frameScrewHoleArray = [
[-skirtX/2-innerCaseRadius/2,-skirtY/2-innerCaseRadius/2], //lower row
[caseWidth/4,-skirtY/2-innerCaseRadius/2],
[caseWidth/2-lkey,-skirtY/2-innerCaseRadius/2],
[caseWidth/2+lkey,-skirtY/2-innerCaseRadius/2], //lower row
[caseWidth-caseWidth/4,-skirtY/2-innerCaseRadius/2],
[caseWidth+skirtX/2+innerCaseRadius/2,-skirtY/2-innerCaseRadius/2],
[-skirtX/2-innerCaseRadius/2,lkey*1.5], //lower row
[caseWidth+skirtX/2+innerCaseRadius/2,lkey*1.5],
[-skirtX/2-innerCaseRadius/2,caseDepth-lkey*0.75], //lower row
[caseWidth/2-lkey,caseDepth-lkey*0.75],
[caseWidth/4,caseDepth-lkey*0.75],
[caseWidth/2+lkey,caseDepth-lkey*0.75], //lower row
[caseWidth-caseWidth/4,caseDepth-lkey*0.75],
[caseWidth+skirtX/2+innerCaseRadius/2,caseDepth-lkey*0.75],
[-skirtX/2-innerCaseRadius/2,caseDepth+lkey*0.5+skirtY/2+innerCaseRadius/2], //lower row
[caseWidth/4,caseDepth+lkey*0.5+skirtY/2+innerCaseRadius/2],
[caseWidth/2-lkey,caseDepth+lkey*0.5+skirtY/2+innerCaseRadius/2],
[caseWidth/2+lkey,caseDepth+lkey*0.5+skirtY/2+innerCaseRadius/2], //lower row
[caseWidth-caseWidth/4,caseDepth+lkey*0.5+skirtY/2+innerCaseRadius/2],
[caseWidth+skirtX/2+innerCaseRadius/2,caseDepth+lkey*0.5+skirtY/2+innerCaseRadius/2]
];
/* set colors for simulation, set 0 for default OpenSCAD Gui Colors */
colorCaseTop="Grey";
colorCaseMid="Grey";
colorLid="DarkGrey";
colorRiserR="DarkGrey";
colorRiserL="DarkGrey";
frameColor="Black";
/* color simulation for switches
select top and bottom color */
switchColorTop = "Ivory";
switchColorBottom = "Black";
/* simulate a keycap profile with number of fragments ($fn = setKeycapFragments)
which will be set to key() call.
KeyV2 currently (2022-06) does not support XDA.
Use DSA as they look very similar
NOTE: DSA is fixed to 3rd row as KeyV2 includes row number into calculation
of DSA caps
NOTE: currently not all profiles are working. OEM or DCS are always simulated! */
keycapProfile = "OEM"; // SA, DSA, DCS, G20, Hi-Pro, OEM
setKeycapFragments = 50;
/* ###################### BUILD_LINE ########################*/
/* ##########################################################*/
/* All calls after this line have to be ignored by the build script.
* Do not place any calls above build line (or comment it)
*/
/* uncomment following line to get the keyboard simulation
* with keycaps. set DoKeycapSimulation to true or false to add
* or remove keycap simulation
*/
KeyboardSim(layout,doFrameSim=false,DoKeycapSimulation=true,xRotate=9.5);
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
/* ##### uncomment the keyboard part you want to print ##### */
/* vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv */
/* ### complete keyboard model ### */
/* mainCase(layout); */
/* lid(); */
/* keycap frame functions. activate if skirt is enabled
and you want a frame that hides the switches, which is
a more classic look to none printed keyboards */
/* translate([0,0,13])
capFrame(layout); */
/* translate([0,0,13])
capFrameR(layout); */
/* translate([0,0,13])
capFrameL(layout); */
/* ### devided keyboard and lid model ### */
/* mainCaseLeft(layout); */
/* mainCaseRight(layout); */
/* lidL(); */
/* lidR(); */
/* keyboardRiser(); */