-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext.js
42 lines (37 loc) · 804 Bytes
/
text.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
// Description:
// Allows you to place text on the PCB.
module.exports = {
params: {
designator: 'TXT',
side: 'F',
text: 'Hello world!',
h_size: 1,
v_size: 1,
thickness: 0.15,
justify: "",
},
body: p => {
let justify = "";
if (p.justify != "") {
justify = `(justify ${p.justify})`;
}
const front = `
(gr_text "${p.text}" ${p.at} (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
`
const back = `
(gr_text "${p.text}" ${p.at} (layer B.SilkS)
(effects (font (size ${p.h_size} ${p.v_size}) (thickness ${p.thickness})) ${justify})
)
`
let final = '';
if(p.side == "F") {
final += front;
}
if(p.side == "B") {
final += back;
}
return final;
}
}