Footprint parameter flattening done
This commit is contained in:
parent
3a0f326a31
commit
58bb16ed28
31 changed files with 316 additions and 350 deletions
BIN
test/fixtures/bundle.zip
vendored
BIN
test/fixtures/bundle.zip
vendored
Binary file not shown.
2
test/fixtures/bundle/footprints/injected.js
vendored
2
test/fixtures/bundle/footprints/injected.js
vendored
|
@ -1,6 +1,6 @@
|
|||
module.exports = {
|
||||
params: {
|
||||
class: 'I'
|
||||
designator: 'I'
|
||||
},
|
||||
body: p => `
|
||||
(module injected_test_footprint (layer F.Cu) (tedit 5E1ADAC2)
|
||||
|
|
|
@ -3,15 +3,14 @@ pcbs.pcb.footprints:
|
|||
|
||||
# front
|
||||
- what: button
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
|
||||
# back
|
||||
- what: button
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
side: B
|
||||
adjust.shift: [50, 0]
|
|
@ -3,43 +3,39 @@ pcbs.pcb.footprints:
|
|||
|
||||
# base
|
||||
- what: choc
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
|
||||
# keycap visualization
|
||||
- what: choc
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
keycaps: true
|
||||
adjust.shift: [50, 0]
|
||||
|
||||
# reverse
|
||||
- what: choc
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
reverse: true
|
||||
adjust.shift: [100, 0]
|
||||
|
||||
# hotswap
|
||||
- what: choc
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
hotswap: true
|
||||
adjust.shift: [150, 0]
|
||||
|
||||
# both reverse and hotswap
|
||||
- what: choc
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
reverse: true
|
||||
hotswap: true
|
||||
adjust.shift: [200, 0]
|
|
@ -3,24 +3,22 @@ pcbs.pcb.footprints:
|
|||
|
||||
# base
|
||||
- what: chocmini
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
|
||||
# keycap visualization
|
||||
- what: chocmini
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
keycaps: true
|
||||
adjust.shift: [50, 0]
|
||||
|
||||
# reverse
|
||||
- what: chocmini
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
reverse: true
|
||||
adjust.shift: [100, 0]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
points.zones.matrix:
|
||||
pcbs.pcb.footprints:
|
||||
- what: diode
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
|
@ -3,43 +3,39 @@ pcbs.pcb.footprints:
|
|||
|
||||
# base
|
||||
- what: mx
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
|
||||
# keycap visualization
|
||||
- what: mx
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
keycaps: true
|
||||
adjust.shift: [50, 0]
|
||||
|
||||
# reverse
|
||||
- what: mx
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
reverse: true
|
||||
adjust.shift: [100, 0]
|
||||
|
||||
# hotswap
|
||||
- what: mx
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
hotswap: true
|
||||
adjust.shift: [150, 0]
|
||||
|
||||
# both reverse and hotswap
|
||||
- what: mx
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
params:
|
||||
reverse: true
|
||||
hotswap: true
|
||||
adjust.shift: [200, 0]
|
|
@ -2,29 +2,26 @@ points.zones.matrix:
|
|||
pcbs.pcb.footprints:
|
||||
|
||||
- what: pad
|
||||
nets:
|
||||
params:
|
||||
net: net
|
||||
|
||||
- what: pad
|
||||
nets:
|
||||
net: net
|
||||
params:
|
||||
net: net
|
||||
align: right
|
||||
text: text
|
||||
adjust.shift: [50, 0]
|
||||
|
||||
- what: pad
|
||||
nets:
|
||||
net: net
|
||||
params:
|
||||
net: net
|
||||
align: up
|
||||
front: false
|
||||
adjust.shift: [0, 50]
|
||||
|
||||
- what: pad
|
||||
nets:
|
||||
net: net
|
||||
params:
|
||||
net: net
|
||||
align: down
|
||||
mirrored: true
|
||||
adjust.shift: [50, 50]
|
||||
|
|
|
@ -2,42 +2,42 @@ points.zones.matrix:
|
|||
pcbs.pcb.footprints:
|
||||
|
||||
- what: alps
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
|
||||
- what: jstph
|
||||
nets:
|
||||
params:
|
||||
pos: pos
|
||||
neg: neg
|
||||
adjust.shift: [50, 0]
|
||||
|
||||
- what: jumper
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
adjust.shift: [100, 0]
|
||||
|
||||
- what: oled
|
||||
nets:
|
||||
params:
|
||||
SDA: SDA
|
||||
SCL: SCL
|
||||
adjust.shift: [0, 50]
|
||||
|
||||
- what: omron
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
adjust.shift: [50, 50]
|
||||
|
||||
- what: rgb
|
||||
nets:
|
||||
params:
|
||||
din: din
|
||||
dout: dout
|
||||
adjust.shift: [100, 50]
|
||||
|
||||
- what: rotary
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
A: A
|
||||
|
@ -46,7 +46,7 @@ pcbs.pcb.footprints:
|
|||
adjust.shift: [0, 100]
|
||||
|
||||
- what: scrollwheel
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
A: A
|
||||
|
@ -56,12 +56,12 @@ pcbs.pcb.footprints:
|
|||
adjust.shift: [50, 100]
|
||||
|
||||
- what: slider
|
||||
nets:
|
||||
params:
|
||||
from: from
|
||||
to: to
|
||||
adjust.shift: [100, 100]
|
||||
|
||||
- what: via
|
||||
nets:
|
||||
params:
|
||||
net: net
|
||||
adjust.shift: [0, 150]
|
|
@ -3,7 +3,7 @@ pcbs.pcb.footprints:
|
|||
|
||||
# basic
|
||||
- what: trrs
|
||||
nets:
|
||||
params:
|
||||
A: A
|
||||
B: B
|
||||
C: C
|
||||
|
@ -11,23 +11,21 @@ pcbs.pcb.footprints:
|
|||
|
||||
# reversible
|
||||
- what: trrs
|
||||
nets:
|
||||
params:
|
||||
A: A
|
||||
B: B
|
||||
C: C
|
||||
D: D
|
||||
params:
|
||||
reverse: true
|
||||
adjust.shift: [50, 0]
|
||||
|
||||
# reversible + symmetric
|
||||
- what: trrs
|
||||
nets:
|
||||
params:
|
||||
A: A
|
||||
B: B
|
||||
C: C
|
||||
D: D
|
||||
params:
|
||||
reverse: true
|
||||
symmetric: true
|
||||
adjust.shift: [100, 0]
|
|
@ -1,11 +1,9 @@
|
|||
exports.inject = (ergogen) => {
|
||||
ergogen.inject('footprint', 'trace_test', {
|
||||
nets: {
|
||||
P1: 'P1'
|
||||
},
|
||||
params: {
|
||||
class: 'T',
|
||||
side: 'F'
|
||||
designator: 'T',
|
||||
side: 'F',
|
||||
P1: {type: 'net', value: 'P1'}
|
||||
},
|
||||
body: p => {
|
||||
return `
|
||||
|
@ -15,26 +13,24 @@ exports.inject = (ergogen) => {
|
|||
${p.at /* parametric position */}
|
||||
|
||||
(pad 1 smd rect (at 0 0 ${p.rot}) (size 1 1) (layers F.Cu F.Paste F.Mask)
|
||||
${p.net.P1.str} (solder_mask_margin 0.2))
|
||||
${p.P1.str} (solder_mask_margin 0.2))
|
||||
|
||||
(pad 2 smd rect (at 5 5 ${p.rot}) (size 1 1) (layers F.Cu F.Paste F.Mask)
|
||||
${p.net.P1.str} (solder_mask_margin 0.2))
|
||||
${p.P1.str} (solder_mask_margin 0.2))
|
||||
|
||||
)
|
||||
|
||||
(segment (start ${p.xy(0, 0)}) (end ${p.xy(5, 5)}) (width 0.25) (layer F.Cu) (net ${p.net.P1.index}))
|
||||
(segment (start ${p.xy(0, 0)}) (end ${p.xy(5, 5)}) (width 0.25) (layer F.Cu) (net ${p.P1.index}))
|
||||
|
||||
`
|
||||
}
|
||||
})
|
||||
|
||||
ergogen.inject('footprint', 'zone_test', {
|
||||
nets: {
|
||||
P1: 'P1'
|
||||
},
|
||||
params: {
|
||||
class: 'T',
|
||||
side: 'F'
|
||||
designator: 'T',
|
||||
side: 'F',
|
||||
P1: {type: 'net', value: 'P1'}
|
||||
},
|
||||
body: p => {
|
||||
return `
|
||||
|
@ -44,14 +40,14 @@ exports.inject = (ergogen) => {
|
|||
${p.at /* parametric position */}
|
||||
|
||||
(pad 1 smd rect (at 0 0 ${p.rot}) (size 1 1) (layers F.Cu F.Paste F.Mask)
|
||||
${p.net.P1.str} (solder_mask_margin 0.2))
|
||||
${p.P1.str} (solder_mask_margin 0.2))
|
||||
|
||||
(pad 2 smd rect (at 5 5 ${p.rot}) (size 1 1) (layers F.Cu F.Paste F.Mask)
|
||||
${p.net.P1.str} (solder_mask_margin 0.2))
|
||||
${p.P1.str} (solder_mask_margin 0.2))
|
||||
|
||||
)
|
||||
|
||||
(zone (net ${p.net.P1.index}) (net_name ${p.net.P1.name}) (layer ${p.param.side}.Cu) (tstamp 0) (hatch full 0.508)
|
||||
(zone (net ${p.P1.index}) (net_name ${p.P1.name}) (layer ${p.side}.Cu) (tstamp 0) (hatch full 0.508)
|
||||
(connect_pads (clearance 0.508))
|
||||
(min_thickness 0.254)
|
||||
(fill yes (arc_segments 32) (thermal_gap 0.508) (thermal_bridge_width 0.508))
|
||||
|
@ -63,9 +59,8 @@ exports.inject = (ergogen) => {
|
|||
})
|
||||
|
||||
ergogen.inject('footprint', 'dynamic_net_test', {
|
||||
nets: {},
|
||||
params: {
|
||||
class: 'T',
|
||||
designator: 'T',
|
||||
side: 'F'
|
||||
},
|
||||
body: p => {
|
||||
|
@ -91,13 +86,10 @@ exports.inject = (ergogen) => {
|
|||
})
|
||||
|
||||
ergogen.inject('footprint', 'anchor_test', {
|
||||
nets: {},
|
||||
params: {
|
||||
class: 'T',
|
||||
side: 'F'
|
||||
},
|
||||
anchors: {
|
||||
end: undefined
|
||||
designator: 'T',
|
||||
side: 'F',
|
||||
end: {type: 'anchor', value: undefined}
|
||||
},
|
||||
body: p => {
|
||||
return `
|
||||
|
@ -106,7 +98,7 @@ exports.inject = (ergogen) => {
|
|||
|
||||
${p.at /* parametric position */}
|
||||
|
||||
(fp_line (start 0 0) (end ${p.anchors.end.x} ${p.anchors.end.y}) (layer Dwgs.User) (width 0.05))
|
||||
(fp_line (start 0 0) (end ${p.end.x} ${p.end.y}) (layer Dwgs.User) (width 0.05))
|
||||
|
||||
)
|
||||
|
||||
|
@ -115,7 +107,6 @@ exports.inject = (ergogen) => {
|
|||
})
|
||||
|
||||
ergogen.inject('footprint', 'references_test', {
|
||||
nets: {},
|
||||
params: {},
|
||||
body: p => {
|
||||
return `references ${p.ref_hide ? 'hidden' : 'shown'}`
|
||||
|
|
|
@ -24,7 +24,7 @@ pcbs:
|
|||
what: dynamic_net_test
|
||||
anc:
|
||||
what: anchor_test
|
||||
anchors:
|
||||
params:
|
||||
end:
|
||||
ref: matrix
|
||||
shift: [10, 10]
|
Loading…
Add table
Add a link
Reference in a new issue