diff --git a/src/outlines.js b/src/outlines.js index afce975..f837cde 100644 --- a/src/outlines.js +++ b/src/outlines.js @@ -194,7 +194,6 @@ exports.parse = (config, points, units) => { const where = units => filter(original_where, `${name}.where`, points, units, asym) 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) expand_shorthand(part, `${name}.expand`, units) const expand = a.sane(part.expand || 0, `${name}.expand`, 'number')(units) @@ -215,6 +214,7 @@ exports.parse = (config, points, units) => { // a prototype "shape" maker (and its units) are computed const [shape_maker, shape_units] = whats[what](part, name, points, outlines, units) + const adjust = start => anchor(original_adjust || {}, `${name}.adjust`, points, start)(shape_units) // and then the shape is repeated for all where positions for (const w of where(shape_units)) { diff --git a/test/outlines/outlines.yaml b/test/outlines/outlines.yaml index 9c58ce3..99a70b6 100644 --- a/test/outlines/outlines.yaml +++ b/test/outlines/outlines.yaml @@ -16,6 +16,12 @@ outlines: where: true size: cy bound: true + adjust: + - what: circle + where: true + radius: 2 + # adjust works, and it can use shape-specific units + adjust.shift: [0, r] fillet: - name: base fillet: 2 diff --git a/test/outlines/outlines___outlines_adjust_dxf.dxf b/test/outlines/outlines___outlines_adjust_dxf.dxf new file mode 100644 index 0000000..5a902b7 --- /dev/null +++ b/test/outlines/outlines___outlines_adjust_dxf.dxf @@ -0,0 +1,90 @@ +0 +SECTION +2 +HEADER +9 +$INSUNITS +70 +4 +0 +ENDSEC +0 +SECTION +2 +TABLES +0 +TABLE +2 +LTYPE +0 +LTYPE +72 +65 +70 +64 +2 +CONTINUOUS +3 +______ +73 +0 +40 +0 +0 +ENDTAB +0 +TABLE +2 +LAYER +0 +ENDTAB +0 +ENDSEC +0 +SECTION +2 +ENTITIES +0 +CIRCLE +8 +0 +10 +0 +20 +2 +40 +2 +0 +CIRCLE +8 +0 +10 +0 +20 +19 +40 +2 +0 +CIRCLE +8 +0 +10 +19 +20 +2 +40 +2 +0 +CIRCLE +8 +0 +10 +19 +20 +19 +40 +2 +0 +ENDSEC +0 +EOF \ No newline at end of file