Ergogen: Finalize PCB

This commit is contained in:
Lexi / Zoe 2024-08-03 19:14:18 +02:00
parent 6bf16ac7fe
commit 31995f676a
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
3 changed files with 124 additions and 12 deletions

View file

@ -0,0 +1,24 @@
// MountingHole_2.2mm_M2
// Source: https://kicad.github.io/footprints/MountingHole
module.exports = {
nets: {
net: undefined
},
params: {
class: 'HOLE',
},
body: p => `
(module MountingHole_2.2mm_M2 (layer F.Cu) (tedit 56D1B4CB)
${p.at /* parametric position */}
(fp_text reference "${p.ref}" (at 0 -3.2) (layer F.SilkS) ${p.ref_hide}
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_circle (center 0 0) (end 2.2 0) (layer Cmts.User) (width 0.15))
(fp_circle (center 0 0) (end 2.45 0) (layer F.CrtYd) (width 0.05))
(pad 1 np_thru_hole circle (at 0 0) (size 2.2 2.2) (drill 2.2) (layers *.Cu *.Mask))
)
`
}

View 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)
)
)
)
`;
}
}