-
Notifications
You must be signed in to change notification settings - Fork 0
/
button.js
44 lines (43 loc) · 2.48 KB
/
button.js
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
module.exports = {
params: {
designator: 'B', // for Button
side: 'F',
from: undefined,
to: undefined
},
body: p => {
const footprint = `
(module SW_FSM8JH (layer ${p.side}.Cu) (tedit 659AFCD2)
${p.at /* parametric position */}
(descr "")
(fp_text reference ${p.ref} (at -1.71258 -4.01401 0) (layer ${p.side}.SilkS)
(effects (font (size 0.801196850394 0.801196850394) (thickness 0.15)))
)
(fp_text value SW_FSM8JH (at 0.50808 3.9377 0) (layer ${p.side}.Fab)
(effects (font (size 0.800141732283 0.800141732283) (thickness 0.15)))
)
(pad 1 thru_hole rect (at -3.25 -2.25) (size 1.498 1.498) (drill 0.99) (layers *.Cu *.Mask) ${p.to.str})
(pad 3 thru_hole circle (at 3.25 -2.25) (size 1.498 1.498) (drill 0.99) (layers *.Cu *.Mask))
(pad 2 thru_hole circle (at -3.25 2.25) (size 1.498 1.498) (drill 0.99) (layers *.Cu *.Mask) ${p.from.str})
(pad 4 thru_hole circle (at 3.25 2.25) (size 1.498 1.498) (drill 0.99) (layers *.Cu *.Mask))
(fp_line (start -2.995 -2.995) (end -2.995 2.995) (layer ${p.side}.Fab) (width 0.127))
(fp_line (start -2.995 2.995) (end 2.995 2.995) (layer ${p.side}.Fab) (width 0.127))
(fp_line (start 2.995 2.995) (end 2.995 -2.995) (layer ${p.side}.Fab) (width 0.127))
(fp_line (start 2.995 -2.995) (end -2.995 -2.995) (layer ${p.side}.Fab) (width 0.127))
(fp_circle (center 0.0 0.0) (end 1.75 0.0) (layer ${p.side}.Fab) (width 0.127))
(fp_line (start -3.0 -1.0) (end -3.0 1.0) (layer ${p.side}.SilkS) (width 0.127))
(fp_line (start 3.0 -1.0) (end 3.0 1.0) (layer ${p.side}.SilkS) (width 0.127))
(fp_line (start -2.0 -3.0) (end 2.0 -3.0) (layer ${p.side}.SilkS) (width 0.127))
(fp_line (start -2.0 3.0) (end 2.0 3.0) (layer ${p.side}.SilkS) (width 0.127))
(fp_circle (center 0.0 0.0) (end 1.75 0.0) (layer ${p.side}.SilkS) (width 0.127))
(fp_line (start -4.25 -3.25) (end 4.25 -3.25) (layer ${p.side}.CrtYd) (width 0.05))
(fp_line (start 4.25 -3.25) (end 4.25 3.245) (layer ${p.side}.CrtYd) (width 0.05))
(fp_line (start 4.25 3.245) (end -4.25 3.245) (layer ${p.side}.CrtYd) (width 0.05))
(fp_line (start -4.25 3.245) (end -4.25 -3.25) (layer ${p.side}.CrtYd) (width 0.05))
(fp_circle (center -4.75 -2.25) (end -4.55 -2.25) (layer ${p.side}.SilkS) (width 0.4))
(fp_circle (center -3.25 -2.25) (end -3.05 -2.25) (layer ${p.side}.Fab) (width 0.4))
)
`
return footprint;
}
}