2021-07-11 11:36:11 -07:00
|
|
|
exports.inject = (ergogen) => {
|
2022-11-13 15:40:05 -08:00
|
|
|
ergogen.inject('footprint', 'trace_test', {
|
2021-07-11 11:36:11 -07:00
|
|
|
params: {
|
2022-12-04 09:40:06 -08:00
|
|
|
designator: 'T',
|
|
|
|
side: 'F',
|
2023-01-23 01:02:08 -08:00
|
|
|
width: 0.25,
|
2022-12-04 09:40:06 -08:00
|
|
|
P1: {type: 'net', value: 'P1'}
|
2021-07-11 11:36:11 -07:00
|
|
|
},
|
|
|
|
body: p => {
|
|
|
|
return `
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(module trace_test (layer ${p.side}.Cu) (tedit 5CF31DEF)
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
${p.at /* parametric position */}
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(pad 1 smd rect (at ${p.ixy(0, 0)} ${p.rot}) (size 1 1) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask)
|
2022-12-04 09:40:06 -08:00
|
|
|
${p.P1.str} (solder_mask_margin 0.2))
|
2021-07-11 11:36:11 -07:00
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(pad 2 smd rect (at ${p.ixy(5, 5)} ${p.rot}) (size 1 1) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask)
|
2022-12-04 09:40:06 -08:00
|
|
|
${p.P1.str} (solder_mask_margin 0.2))
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
)
|
|
|
|
|
2023-01-23 01:02:08 -08:00
|
|
|
(segment (start ${p.sxy(0, 0)}) (end ${p.sxy(5, 5)}) (width ${p.width}) (layer ${p.side}.Cu) (net ${p.P1.index}))
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
`
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2022-11-13 15:40:05 -08:00
|
|
|
ergogen.inject('footprint', 'zone_test', {
|
2021-07-11 11:36:11 -07:00
|
|
|
params: {
|
2022-12-04 09:40:06 -08:00
|
|
|
designator: 'T',
|
|
|
|
side: 'F',
|
|
|
|
P1: {type: 'net', value: 'P1'}
|
2021-07-11 11:36:11 -07:00
|
|
|
},
|
|
|
|
body: p => {
|
|
|
|
return `
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(module zone_test (layer ${p.side}.Cu) (tedit 5CF31DEF)
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
${p.at /* parametric position */}
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(pad 1 smd rect (at 0 0 ${p.rot}) (size 1 1) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask)
|
2022-12-04 09:40:06 -08:00
|
|
|
${p.P1.str} (solder_mask_margin 0.2))
|
2021-07-11 11:36:11 -07:00
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(pad 2 smd rect (at 5 5 ${p.rot}) (size 1 1) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask)
|
2022-12-04 09:40:06 -08:00
|
|
|
${p.P1.str} (solder_mask_margin 0.2))
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
)
|
|
|
|
|
2022-12-04 09:40:06 -08:00
|
|
|
(zone (net ${p.P1.index}) (net_name ${p.P1.name}) (layer ${p.side}.Cu) (tstamp 0) (hatch full 0.508)
|
2021-07-11 11:36:11 -07:00
|
|
|
(connect_pads (clearance 0.508))
|
|
|
|
(min_thickness 0.254)
|
|
|
|
(fill yes (arc_segments 32) (thermal_gap 0.508) (thermal_bridge_width 0.508))
|
|
|
|
(polygon (pts (xy ${p.xy(5, 5)}) (xy ${p.xy(5, -5)}) (xy ${p.xy(-5, -5)}) (xy ${p.xy(-5, 5)})))
|
|
|
|
)
|
|
|
|
|
|
|
|
`
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2022-11-13 15:40:05 -08:00
|
|
|
ergogen.inject('footprint', 'dynamic_net_test', {
|
2021-07-11 11:36:11 -07:00
|
|
|
params: {
|
2022-12-04 09:40:06 -08:00
|
|
|
designator: 'T',
|
2021-07-11 11:36:11 -07:00
|
|
|
side: 'F'
|
|
|
|
},
|
|
|
|
body: p => {
|
|
|
|
return `
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(module dynamic_net_test (layer ${p.side}.Cu) (tedit 5CF31DEF)
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
${p.at /* parametric position */}
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(pad 1 smd rect (at 0 0 ${p.rot}) (size 1 1) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask)
|
2021-07-11 11:36:11 -07:00
|
|
|
${p.local_net('1').str} (solder_mask_margin 0.2))
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(pad 1 smd rect (at 0 0 ${p.rot}) (size 1 1) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask)
|
2021-07-11 11:36:11 -07:00
|
|
|
${p.local_net('2').str} (solder_mask_margin 0.2))
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(pad 1 smd rect (at 0 0 ${p.rot}) (size 1 1) (layers ${p.side}.Cu ${p.side}.Paste ${p.side}.Mask)
|
2021-07-11 11:36:11 -07:00
|
|
|
${p.local_net('3').str} (solder_mask_margin 0.2))
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
`
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2022-11-13 15:40:05 -08:00
|
|
|
ergogen.inject('footprint', 'anchor_test', {
|
2021-07-11 11:36:11 -07:00
|
|
|
params: {
|
2022-12-04 09:40:06 -08:00
|
|
|
designator: 'T',
|
|
|
|
side: 'F',
|
|
|
|
end: {type: 'anchor', value: undefined}
|
2021-07-11 11:36:11 -07:00
|
|
|
},
|
|
|
|
body: p => {
|
|
|
|
return `
|
|
|
|
|
2022-12-04 11:58:46 -08:00
|
|
|
(module anchor_test (layer ${p.side}.Cu) (tedit 5CF31DEF)
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
${p.at /* parametric position */}
|
|
|
|
|
2022-12-04 09:40:06 -08:00
|
|
|
(fp_line (start 0 0) (end ${p.end.x} ${p.end.y}) (layer Dwgs.User) (width 0.05))
|
2021-07-11 11:36:11 -07:00
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
`
|
|
|
|
}
|
|
|
|
})
|
2021-12-15 12:42:37 -08:00
|
|
|
|
2023-01-23 14:34:06 -08:00
|
|
|
ergogen.inject('footprint', 'arrobj_test', {
|
|
|
|
params: {
|
|
|
|
designator: 'T',
|
|
|
|
side: 'F',
|
|
|
|
start: {x: 0, y: 0},
|
|
|
|
end: [[1, 0], [0, 1]]
|
|
|
|
},
|
|
|
|
body: p => {
|
|
|
|
lines = ''
|
|
|
|
for (const item of p.end) {
|
|
|
|
lines += `(fp_line (start ${p.start.x} ${p.start.y}) (end ${item[0]} ${item[1]}) (layer Dwgs.User) (width 0.05))\n`
|
|
|
|
}
|
|
|
|
return `
|
|
|
|
|
|
|
|
(module arrobj_test (layer ${p.side}.Cu) (tedit 5CF31DEF)
|
|
|
|
|
|
|
|
${p.at /* parametric position */}
|
|
|
|
|
|
|
|
${lines}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
`
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2023-01-23 01:02:08 -08:00
|
|
|
ergogen.inject('references_test', {
|
2021-12-15 12:42:37 -08:00
|
|
|
params: {},
|
|
|
|
body: p => {
|
|
|
|
return `references ${p.ref_hide ? 'hidden' : 'shown'}`
|
|
|
|
}
|
|
|
|
})
|
2021-07-11 11:36:11 -07:00
|
|
|
}
|