Ergogen: Finalize PCB
This commit is contained in:
parent
6bf16ac7fe
commit
31995f676a
3 changed files with 124 additions and 12 deletions
38
ergogen/footprints/text.js
Normal file
38
ergogen/footprints/text.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// Graphical text box to render text (e.g. project name, copyright) onto the board
|
||||
//
|
||||
// The text can be multi-line. Linebreaks and quotes are automatically escaped.
|
||||
// Backslashes are *not* escaped to allow for other escape sequences.
|
||||
//
|
||||
// Params
|
||||
// side: Side of the PCB ("F" or "B")
|
||||
// text: Text to be rendered
|
||||
|
||||
module.exports = {
|
||||
params: {
|
||||
layer: 'F.SilkS',
|
||||
text: 'Example text!',
|
||||
},
|
||||
body: p => {
|
||||
function escape_str(text) {
|
||||
return text
|
||||
.replace('"', '\\"')
|
||||
.replace('\n', '\\n')
|
||||
.replace('\r', '')
|
||||
}
|
||||
|
||||
return `
|
||||
(gr_text "${escape_str(p.text)}"
|
||||
${p.at /* parametric position */}
|
||||
|
||||
(layer ${p.layer})
|
||||
(effects
|
||||
(font
|
||||
(size 1.5 1.5)
|
||||
(thickness 0.3)
|
||||
(bold yes)
|
||||
)
|
||||
)
|
||||
)
|
||||
`;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue