Make outline/pcb anchor adjustments more generic
This commit is contained in:
parent
158dc33212
commit
2cfdf10327
2 changed files with 6 additions and 4 deletions
|
@ -198,7 +198,8 @@ exports.parse = (config = {}, points = {}, units = {}) => {
|
||||||
const original_where = part.where // need to save, so the delete's don't get rid of it below
|
const original_where = part.where // need to save, so the delete's don't get rid of it below
|
||||||
const where = units => filter(original_where, `${name}.where`, points, units, asym)
|
const where = units => filter(original_where, `${name}.where`, points, units, asym)
|
||||||
|
|
||||||
const adjust = anchor(part.adjust || {}, `${name}.adjust`, points)(units)
|
const original_adjust = part.adjust // same as above
|
||||||
|
const adjust = start => anchor(original_adjust || {}, `${name}.adjust`, points, start)(units)
|
||||||
const fillet = a.sane(part.fillet || 0, `${name}.fillet`, 'number')(units)
|
const fillet = a.sane(part.fillet || 0, `${name}.fillet`, 'number')(units)
|
||||||
expand_shorthand(part, units)
|
expand_shorthand(part, units)
|
||||||
const expand = a.sane(part.expand || 0, `${name}.expand`, 'number')(units)
|
const expand = a.sane(part.expand || 0, `${name}.expand`, 'number')(units)
|
||||||
|
@ -222,7 +223,7 @@ exports.parse = (config = {}, points = {}, units = {}) => {
|
||||||
|
|
||||||
// and then the shape is repeated for all where positions
|
// and then the shape is repeated for all where positions
|
||||||
for (const w of where(shape_units)) {
|
for (const w of where(shape_units)) {
|
||||||
const point = w.clone().shift(adjust.p).rotate(adjust.r, false)
|
const point = adjust(w.clone())
|
||||||
let [shape, bbox] = shape_maker(point) // point is passed for mirroring metadata only...
|
let [shape, bbox] = shape_maker(point) // point is passed for mirroring metadata only...
|
||||||
if (bound) {
|
if (bound) {
|
||||||
shape = binding(shape, bbox, point, shape_units)
|
shape = binding(shape, bbox, point, shape_units)
|
||||||
|
|
|
@ -283,12 +283,13 @@ exports.parse = (config, points, outlines, units) => {
|
||||||
a.sane(f, name, 'object')()
|
a.sane(f, name, 'object')()
|
||||||
const asym = a.asym(f.asym || 'source', `${name}.asym`)
|
const asym = a.asym(f.asym || 'source', `${name}.asym`)
|
||||||
const where = filter(f.where, `${name}.where`, points, units, asym)
|
const where = filter(f.where, `${name}.where`, points, units, asym)
|
||||||
const adjust = anchor(f.adjust || {}, `${name}.adjust`, points)(units)
|
const original_adjust = f.adjust // need to save, so the delete's don't get rid of it below
|
||||||
|
const adjust = start => anchor(original_adjust || {}, `${name}.adjust`, points, start)(units)
|
||||||
delete f.asym
|
delete f.asym
|
||||||
delete f.where
|
delete f.where
|
||||||
delete f.adjust
|
delete f.adjust
|
||||||
for (const w of where) {
|
for (const w of where) {
|
||||||
const aw = w.clone().shift(adjust.p).rotate(adjust.r, false)
|
const aw = adjust(w.clone())
|
||||||
footprints.push(footprint_factory(f, name, aw))
|
footprints.push(footprint_factory(f, name, aw))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue