-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlkp-assy-ex.scad
612 lines (530 loc) · 18.2 KB
/
lkp-assy-ex.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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
use <MCAD/2Dshapes.scad>;
use <hsi.scad>
/* [Build Options] */
// Build target
TARGET="nothing"; // ["nothing", "dummy", "demo_assy", "blocks", "2d_overlay_profile", "2d_assy_drill_profile"]
// Preview target
PREVIEW="2d_assy"; // ["2d_assy", "2d_led_cover", "2d_base", "2d_lkp_conn_cutout", "2d_drill_assy", "2d_drill", "2d_cable_hole", "build"]
/* [General Parameters] */
// Minimum thickness of the base.
BASE_MIN_THICKNESS = 2;
// Thickness of the extended LED strip backing structure.
LED_BACKING_THICKNESS = 2;
// Width of the top extension.
TOP_EXT_WIDTH = 8;
// Width of the bottom extension.
BOTTOM_EXT_WIDTH = 8;
// Width of the bottom adhesive (must be <= BOTTOM_EXT_WIDTH. Recommended to be < BOTTOM_EXT_WIDTH for best Alpaca integration).
BOTTOM_EXT_ADH_WIDTH = 6.5;
// Width of the side extension.
SIDE_EXT_WIDTH = 4;
/* [Heat set inserts (HSI) parameters] */
// Diameter of the hole. Should be slightly smaller than the outer diameter of HSI.
HSI_D_MIN = 3.8;
// Depth of the hole or total length of the HSI.
HSI_DEPTH = 3.6;
// Hole depth multiplier for compensating oozing material during insertion. 1.5 should be good for most of the cases.
HSI_DEPTH_MULTIPLIER = 1.5;
// Diameter of the taper (set this and HSI_DEPTH_TAPER to -1 to disable taper)
HSI_D_TAPER = 4.3;
// Depth of the taper (set this and HSI_D_TAPER to-1 to disable taper)
HSI_DEPTH_TAPER = 1.0;
/* [LED Strip Parameters] */
// Width of the LED strip.
LED_STRIP_WIDTH = 12;
// Thickness of the LED strip.
LED_STRIP_THICKNESS = 3;
// Offset of LED strip. Positive = Move up. Note that the center of each LED must align with the overlay.
LED_STRIP_OFFSET = 0.0;
/* [Slider Parameters] */
// Width of the LKP PCB (40+-tolerance).
LKP_PCB_WIDTH = 40.5;
// Length of the LKP PCB (516+-tolerance).
LKP_PCB_TOTAL_LENGTH = 516.5;
// Thickness of the LKP PCB.
LKP_PCB_THICKNESS = 1.6;
// Offset of the mounting hole.
LKP_SIDE_TAB_MOUNTING_HOLE_OFFSET = 4;
// Width of the side tab.
LKP_SIDE_TAB_WIDTH = 8;
// Width of the overlay portion that is covered by the overlay clamp.
OVERLAY_EXT_WIDTH = 3;
// Thickness of the acrylic/PC overlay.
OVERLAY_THICKNESS = 2;
/* [Hidden] */
EPSILON=0.001;
// Lower width of the strip originating from center of each LED.
_LED_LOWER_WIDTH = LED_STRIP_WIDTH / 2 - LED_STRIP_OFFSET;
// Upper width of the strip originating from center of each LED.
_LED_UPPER_WIDTH = LED_STRIP_WIDTH / 2 + LED_STRIP_OFFSET;
// Width of the base
_BASE_WIDTH = BOTTOM_EXT_WIDTH
+ LKP_PCB_WIDTH
+ OVERLAY_EXT_WIDTH
+ LED_STRIP_THICKNESS
+ LED_BACKING_THICKNESS
+ TOP_EXT_WIDTH;
// How deep should the groove be
_LED_GROOVE_PADDING = _LED_LOWER_WIDTH + OVERLAY_THICKNESS / 2;
// How deep should the PCB cut-out be
_LKP_CUTOUT_DEPTH = LKP_PCB_THICKNESS + OVERLAY_THICKNESS;
_HSI_HOLE_DEPTH = HSI_DEPTH * HSI_DEPTH_MULTIPLIER;
// Minimum thickness + LED groove depth or PCB cut-out depth or HSI hole depth + thickness of overlay and PCB, whichever deeper.
_BASE_THICKNESS = BASE_MIN_THICKNESS
+ max(_LED_GROOVE_PADDING,
_LKP_CUTOUT_DEPTH,
_HSI_HOLE_DEPTH+OVERLAY_THICKNESS+LKP_PCB_THICKNESS);
_LKP_ORIGIN = [BOTTOM_EXT_WIDTH, _BASE_THICKNESS - _LKP_CUTOUT_DEPTH];
// Width of the overlay
_OVERLAY_WIDTH = BOTTOM_EXT_ADH_WIDTH + LKP_PCB_WIDTH + OVERLAY_EXT_WIDTH;
_OVERLAY_CUTOUT = [
_OVERLAY_WIDTH + EPSILON*2,
OVERLAY_THICKNESS + EPSILON
];
_LKP_CUTOUT = [
LKP_PCB_WIDTH,
LKP_PCB_THICKNESS + OVERLAY_THICKNESS
];
_LED_GROOVE_ORIGIN = [
BOTTOM_EXT_WIDTH + LKP_PCB_WIDTH + OVERLAY_EXT_WIDTH,
_BASE_THICKNESS - _LED_GROOVE_PADDING
];
_LED_CABLE_HOLE_ORIGIN = [_LED_GROOVE_ORIGIN.x, 0];
_LED_KEEPOUT = [LED_STRIP_THICKNESS, LED_STRIP_WIDTH];
_LED_KEEPOUT_CABLE_HOLE = [
LED_STRIP_THICKNESS,
LED_STRIP_WIDTH+(_LED_GROOVE_ORIGIN.y-_LED_CABLE_HOLE_ORIGIN.y)
];
_LED_BACKING_ORIGIN = [
_LED_GROOVE_ORIGIN.x + LED_STRIP_THICKNESS,
_LED_GROOVE_ORIGIN.y
];
_LED_BACKING = [LED_BACKING_THICKNESS, LED_STRIP_WIDTH];
// base thickness - LED strip lower width (which is located at the center of overlay) - half of overlay thickness
_LED_GROOVE_TO_BASE_BOTTOM = _BASE_THICKNESS - _LED_LOWER_WIDTH - OVERLAY_THICKNESS/2;
_LED_BACKING_EXT_HEIGHT = LED_STRIP_WIDTH + _LED_GROOVE_TO_BASE_BOTTOM - _BASE_THICKNESS;
_LED_COVER_THICKNESS = OVERLAY_EXT_WIDTH + _LED_BACKING_EXT_HEIGHT;
_LKP_CUTOUT_LENGTH_PER_BLOCK = LKP_PCB_TOTAL_LENGTH / 3;
// TODO Parametric screws
_SCREW_HOLE_DEPTH_BOTTOM = _BASE_THICKNESS - OVERLAY_THICKNESS - 2;
_SCREW_HOLE_DEPTH_TOP = _BASE_THICKNESS + _LED_COVER_THICKNESS - 2;
_SCREW_HOLE_DEPTH_TOP_BASE = _BASE_THICKNESS;
_SCREW_HOLE_DEPTH_TOP_COVER = _BASE_THICKNESS;
_SCREW_LENGTH_COVER = _LED_COVER_THICKNESS - 2 + HSI_DEPTH;
_SCREW_LENGTH_OVERLAY = LKP_PCB_THICKNESS + OVERLAY_THICKNESS + HSI_DEPTH;
_BLOCK_SCREW_HOLE_OFFSET = 30;
//_LED_COVER_SCREW_HOLE_OFFSET = 45;
// Total length of assembly
_ASSY_LENGTH = LKP_PCB_TOTAL_LENGTH+SIDE_EXT_WIDTH*2;
// Sensor center offsets
_SENSOR_ASSY_COFFSET = [0, _BASE_WIDTH / 2 - (BOTTOM_EXT_WIDTH+LKP_PCB_WIDTH/2)];
_SENSOR_OVERLAY_COFFSET = [0, _OVERLAY_WIDTH / 2 - (BOTTOM_EXT_ADH_WIDTH+LKP_PCB_WIDTH/2)];
// Exports
LKP_EXPORT_ASSY_DIM = [_ASSY_LENGTH, _BASE_WIDTH];
LKP_EXPORT_OVERLAY_DIM = [LKP_PCB_TOTAL_LENGTH, _OVERLAY_WIDTH];
LKP_EXPORT_ASSY_ZOFFSET = - _BASE_THICKNESS + OVERLAY_THICKNESS;
function lkp_get_assy_dim() = LKP_EXPORT_ASSY_DIM;
function lkp_get_overlay_dim() = LKP_EXPORT_ASSY_DIM;
function lkp_get_assy_zoffset() = LKP_EXPORT_ASSY_ZOFFSET;
function _bottom_screw_hole(off) = [
BOTTOM_EXT_WIDTH / 2,
// Bottom extension thickness
_BASE_THICKNESS - OVERLAY_THICKNESS + EPSILON,
off
];
function _top_screw_hole_base(off) = [
_LED_BACKING_ORIGIN.x + LED_BACKING_THICKNESS + TOP_EXT_WIDTH / 2,
_BASE_THICKNESS + EPSILON,
off
];
function _top_screw_hole_cover(off) = [
TOP_EXT_WIDTH / 2,
_LED_COVER_THICKNESS + EPSILON,
off
];
function _bottom_hsi(off) = [
BOTTOM_EXT_WIDTH / 2,
// Bottom extension thickness
-EPSILON,
off
];
function _bottom_hsi_2d(off) = [
off,
BOTTOM_EXT_WIDTH / 2
];
function _top_hsi(off) = [
_LED_BACKING_ORIGIN.x + LED_BACKING_THICKNESS + TOP_EXT_WIDTH / 2,
-EPSILON,
off
];
function _top_hsi_2d(off) = [
off,
_LED_BACKING_ORIGIN.x + LED_BACKING_THICKNESS + TOP_EXT_WIDTH / 2
];
function _top_hsi_led_cover(off) = [
_LED_BACKING_ORIGIN.x + LED_BACKING_THICKNESS + TOP_EXT_WIDTH / 2,
_BASE_THICKNESS + EPSILON,
off
];
function _led_cover_screw_hole(off) = [
TOP_EXT_WIDTH / 2,
_LED_COVER_THICKNESS,
off
];
module lkp_assy_profile() {
square(LKP_EXPORT_ASSY_DIM, center=true);
}
module lkp_assy_sensor_center() {
translate(_SENSOR_ASSY_COFFSET) children();
}
module lkp_overlay_sensor_center() {
translate(_SENSOR_OVERLAY_COFFSET) children();
}
module iso7380_m3(length, headless=false) {
dk = 6.0;
d = 3.0 + 0.4;
head_depth = 2;
if (!headless) {
translate([0, 0, -head_depth]) {
cylinder(h=head_depth+EPSILON, d=dk);
}
translate([0, 0, -head_depth-length]) {
cylinder(h=length+EPSILON, d=d);
}
} else {
translate([0, 0, -length]) {
cylinder(h=length+EPSILON, d=d);
}
}
}
module hsi_wrapper() {
hsi(HSI_D_MIN, _HSI_HOLE_DEPTH + EPSILON, d_taper=HSI_D_TAPER, depth_taper=HSI_DEPTH_TAPER);
}
module base_ex(side_ext=false) {
union() {
// Cutouts
difference() {
// Base shape
square([_BASE_WIDTH, _BASE_THICKNESS]);
// Cut out for LKP PCB and overlay
if (!side_ext) {
translate(_LKP_ORIGIN) {
union() {
// PCB
square(_LKP_CUTOUT);
// Overlay (above PCB)
translate([-EPSILON-BOTTOM_EXT_ADH_WIDTH, LKP_PCB_THICKNESS])
square(_OVERLAY_CUTOUT);
}
}
}
if (side_ext) {
translate(_LED_CABLE_HOLE_ORIGIN)
square(_LED_KEEPOUT_CABLE_HOLE);
} else {
// LED groove
translate(_LED_GROOVE_ORIGIN) square(_LED_KEEPOUT);
}
}
// Additions
// LED backing
translate(_LED_BACKING_ORIGIN) square(_LED_BACKING);
}
}
module led_cover_ex() {
union() {
// Cover main body
square([TOP_EXT_WIDTH, _LED_COVER_THICKNESS]);
// Overlay clamp annex
translate([-LED_BACKING_THICKNESS-EPSILON, _LED_BACKING_EXT_HEIGHT]) {
square([
LED_BACKING_THICKNESS + TOP_EXT_WIDTH + EPSILON,
OVERLAY_EXT_WIDTH
]);
}
// Overlay clamp
_overlay_annex_2_height = _LED_COVER_THICKNESS
- LED_STRIP_THICKNESS
- OVERLAY_EXT_WIDTH;
_overlay_annex_2_origin = -LED_BACKING_THICKNESS
- LED_STRIP_THICKNESS
- OVERLAY_EXT_WIDTH;
// Rounded clamp will collide with the overlay
if (_overlay_annex_2_height < 0) {
echo("Rounded clamp will collide with the overlay, fallback to square.");
translate([_overlay_annex_2_origin, 0]) {
square([OVERLAY_EXT_WIDTH, _LED_COVER_THICKNESS]);
translate([0, _LED_BACKING_EXT_HEIGHT]) square([
LED_STRIP_THICKNESS+OVERLAY_EXT_WIDTH,
OVERLAY_EXT_WIDTH
]);
}
} else {
translate([-LED_BACKING_THICKNESS, _overlay_annex_2_height])
donutSlice(
innerSize=LED_STRIP_THICKNESS,
outerSize=LED_STRIP_THICKNESS + OVERLAY_EXT_WIDTH,
start_angle=90,
end_angle=180
);
if (_overlay_annex_2_height != 0) {
translate([_overlay_annex_2_origin, 0])
square([OVERLAY_EXT_WIDTH, _overlay_annex_2_height]);
}
}
}
}
module lkp_connector_cutout_ex() {
translate([-15.625, 0]) square([12, 24], center=true);
translate([15.625, 0]) square([12, 24], center=true);
}
module base_bare() {
// To lay flat horizontally, use
//rotate([90, 0, 90])
linear_extrude(_LKP_CUTOUT_LENGTH_PER_BLOCK) {
base_ex();
}
}
module led_cover_bare() {
linear_extrude(_LKP_CUTOUT_LENGTH_PER_BLOCK) {
led_cover_ex();
}
}
module side_ext_base() {
linear_extrude(SIDE_EXT_WIDTH + EPSILON) {
base_ex(side_ext=true);
}
}
module side_ext_led_cover() {
linear_extrude(SIDE_EXT_WIDTH + EPSILON) {
led_cover_ex();
}
}
module lkp_hsi(off) {
translate([_LKP_ORIGIN.x + (LKP_PCB_WIDTH / 2), _LKP_ORIGIN.y+EPSILON, off]) {
translate([15, 0, 0]) rotate([-90, 0, 0]) hsi_wrapper();
translate([-15, 0, 0]) rotate([-90, 0, 0]) hsi_wrapper();
}
}
module base() {
loff = _BLOCK_SCREW_HOLE_OFFSET;
roff = _LKP_CUTOUT_LENGTH_PER_BLOCK - _BLOCK_SCREW_HOLE_OFFSET;
coff = _LKP_CUTOUT_LENGTH_PER_BLOCK / 2;
difference() {
base_bare();
translate(_bottom_hsi(loff)) rotate([90, 0, 0])
hsi_wrapper();
translate(_bottom_hsi(roff)) rotate([90, 0, 0])
hsi_wrapper();
translate(_top_hsi(coff)) rotate([90, 0, 0])
hsi_wrapper();
translate(_top_hsi_led_cover(loff)) rotate([-90, 0, 0])
hsi_wrapper();
translate(_top_hsi_led_cover(roff)) rotate([-90, 0, 0])
hsi_wrapper();
}
}
module base_drill_profile() {
loff = _BLOCK_SCREW_HOLE_OFFSET;
roff = _LKP_CUTOUT_LENGTH_PER_BLOCK - _BLOCK_SCREW_HOLE_OFFSET;
coff = _LKP_CUTOUT_LENGTH_PER_BLOCK / 2;
translate(_bottom_hsi_2d(loff)) circle(d=3.2);
translate(_bottom_hsi_2d(roff)) circle(d=3.2);
translate(_top_hsi_2d(coff)) circle(d=3.2);
}
module led_cover() {
loff = _BLOCK_SCREW_HOLE_OFFSET;
roff = _LKP_CUTOUT_LENGTH_PER_BLOCK - _BLOCK_SCREW_HOLE_OFFSET;
difference() {
led_cover_bare();
translate(_led_cover_screw_hole(loff)) rotate([-90, 0, 0])
#iso7380_m3(_LED_COVER_THICKNESS-2+EPSILON);
translate(_led_cover_screw_hole(roff)) rotate([-90, 0, 0])
#iso7380_m3(_LED_COVER_THICKNESS-2+EPSILON);
}
}
module base_l() {
difference() {
// Base with ext
union() {
base();
translate([0, 0, -SIDE_EXT_WIDTH]) side_ext_base();
}
// Screw holes for LKP PCB
lkp_hsi(LKP_SIDE_TAB_MOUNTING_HOLE_OFFSET);
}
}
module base_r() {
difference() {
// Base with ext
union() {
base();
translate([0, 0, _LKP_CUTOUT_LENGTH_PER_BLOCK - EPSILON]) side_ext_base();
}
// Screw holes for LKP PCB
lkp_hsi(_LKP_CUTOUT_LENGTH_PER_BLOCK - LKP_SIDE_TAB_MOUNTING_HOLE_OFFSET);
}
}
module base_c() {
difference() {
base();
translate([
_LKP_ORIGIN.x + (LKP_PCB_WIDTH / 2),
-EPSILON,
_LKP_CUTOUT_LENGTH_PER_BLOCK / 2
]) rotate([-90, 90, 0]){
linear_extrude(_LKP_ORIGIN.y + 2 * EPSILON) lkp_connector_cutout_ex();
}
}
}
module led_cover_l() {
led_cover();
translate([0, 0, -SIDE_EXT_WIDTH]) side_ext_led_cover();
}
module led_cover_r() {
led_cover();
translate([0, 0, _LKP_CUTOUT_LENGTH_PER_BLOCK - EPSILON]) side_ext_led_cover();
}
module led_cover_c() {
led_cover();
}
module top_blocks() {
overlay_clamp_len = LED_STRIP_THICKNESS + OVERLAY_EXT_WIDTH + LED_BACKING_THICKNESS;
translate([SIDE_EXT_WIDTH, -10-_BASE_WIDTH, 0]) rotate([90, 0, 90])
base_l();
translate([0, 10, 0]) rotate([90, 0, 90])
base_r();
translate([200, 10, 0]) rotate([90, 0, 90])
base_c();
translate([200+SIDE_EXT_WIDTH, -10-overlay_clamp_len, 0]) rotate([90, 0, 90])
led_cover_l();
translate([200, -30-overlay_clamp_len, 0]) rotate([90, 0, 90])
led_cover_r();
translate([200, -50-overlay_clamp_len, 0]) rotate([90, 0, 90])
led_cover_c();
}
module demo_assy() {
echo("Demo models are for demostration only. DO NOT print!");
rotate([90, 0, 90]) {
base_l();
translate([0, 0, _LKP_CUTOUT_LENGTH_PER_BLOCK]) base_c();
translate([0, 0, _LKP_CUTOUT_LENGTH_PER_BLOCK * 2]) base_r();
translate([_LED_BACKING_ORIGIN.x + _LED_BACKING.x, _BASE_THICKNESS, 0]) {
led_cover_l();
translate([0, 0, _LKP_CUTOUT_LENGTH_PER_BLOCK]) led_cover_c();
translate([0, 0, _LKP_CUTOUT_LENGTH_PER_BLOCK * 2]) led_cover_r();
}
}
}
module assy_drill_profile() {
translate([-SIDE_EXT_WIDTH, 0]) %square(LKP_EXPORT_ASSY_DIM);
for (i=[0:2]) {
translate([_LKP_CUTOUT_LENGTH_PER_BLOCK*i, 0, 0]) base_drill_profile();
}
}
module assy_centered() {
translate([-LKP_PCB_TOTAL_LENGTH/2, -BOTTOM_EXT_WIDTH-LKP_PCB_WIDTH/2, 0])
children();
}
module lkp_assy_cut_profile_centered() {
square([55, 50], center=true);
}
module lkp_assy_drill_profile_centered() {
assy_centered() assy_drill_profile();
}
// Demo assembly. Centered at sensor center.
module lkp_demo_assy_centered() {
assy_centered() demo_assy();
}
module assy_cable_hole_cut_profile() {
translate([-SIDE_EXT_WIDTH, 0]) {
rotate([0, 0, 90]) %base_ex();
%square(LKP_EXPORT_ASSY_DIM);
translate([-SIDE_EXT_WIDTH, _LED_GROOVE_ORIGIN.x])
square([SIDE_EXT_WIDTH*2, _LED_KEEPOUT_CABLE_HOLE.x]);
translate([LKP_PCB_TOTAL_LENGTH+SIDE_EXT_WIDTH, _LED_GROOVE_ORIGIN.x])
square([2*SIDE_EXT_WIDTH, _LED_KEEPOUT_CABLE_HOLE.x]);
}
}
module lkp_assy_cable_hole_cut_profile_centered() {
assy_centered() assy_cable_hole_cut_profile();
}
module lkp_overlay_profile() {
difference() {
square(LKP_EXPORT_OVERLAY_DIM, center=true);
// Left screw holes
translate([-LKP_PCB_TOTAL_LENGTH/2 + LKP_SIDE_TAB_MOUNTING_HOLE_OFFSET, 0])
translate(-_SENSOR_OVERLAY_COFFSET) {
translate([0, -15, 0]) circle(d=3.4);
translate([0, 15, 0]) circle(d=3.4);
}
// Right screw holes
translate([LKP_PCB_TOTAL_LENGTH/2 - LKP_SIDE_TAB_MOUNTING_HOLE_OFFSET, 0])
translate(-_SENSOR_OVERLAY_COFFSET) {
translate([0, -15, 0]) circle(d=3.4);
translate([0, 15, 0]) circle(d=3.4);
}
}
}
module lkp_assy_zposition() {
translate([0, 0, LKP_EXPORT_ASSY_ZOFFSET]) children();
}
// Print dimension info
echo("*** Begin Dimension Info ***");
echo("Extrusion Profile");
echo(led_groove_padding=_LED_GROOVE_PADDING, lkp_cutout_depth=_LKP_CUTOUT_DEPTH);
echo(base_width=_BASE_WIDTH, base_thickness=_BASE_THICKNESS);
echo(overlay_width=_OVERLAY_WIDTH);
echo(led_cover_thickness=_LED_COVER_THICKNESS);
echo("3D Block Profile");
echo(
screw_hole_depth_bottom=_SCREW_HOLE_DEPTH_BOTTOM,
screw_hole_depth_top=_SCREW_HOLE_DEPTH_TOP
);
echo(assy_length=_ASSY_LENGTH);
echo("Screw Lengths");
echo(
cover=_SCREW_LENGTH_COVER,
overlay=_SCREW_LENGTH_OVERLAY,
bottom_without_backing=HSI_DEPTH
);
echo("*** End Dimension Info ***");
// TODO parameters for generating dummies
if ($preview && PREVIEW != "build") {
if (PREVIEW == "2d_assy") {
base_ex();
translate([_LED_BACKING_ORIGIN.x + _LED_BACKING.x, _BASE_THICKNESS]) {
led_cover_ex();
}
} else if (PREVIEW == "2d_led_cover") {
led_cover_ex();
} else if (PREVIEW == "2d_base") {
base_ex();
} else if (PREVIEW == "2d_lkp_conn_cutout") {
lkp_connector_cutout_ex();
} else if (PREVIEW == "2d_drill_assy") {
lkp_assy_drill_profile_centered();
} else if (PREVIEW == "2d_drill") {
base_drill_profile();
} else if (PREVIEW == "2d_cable_hole") {
lkp_assy_cable_hole_cut_profile_centered();
}
} else {
$fn=40;
if (TARGET == "dummy") {
linear_extrude(10) {
base_ex();
}
translate([-TOP_EXT_WIDTH-5, 0]) linear_extrude(10) {
led_cover_ex();
}
} else if (TARGET == "demo_assy") {
demo_assy();
} else if (TARGET == "blocks") {
top_blocks();
} else if (TARGET == "2d_overlay_profile") {
lkp_overlay_profile();
} else if (TARGET == "2d_assy_drill_profile") {
assy_centered() assy_drill_profile();
}
}