Allow outline adjusts to use shape-specific units
This commit is contained in:
parent
14cd499182
commit
e924352763
3 changed files with 97 additions and 1 deletions
|
@ -194,7 +194,6 @@ exports.parse = (config, points, units) => {
|
||||||
const where = units => filter(original_where, `${name}.where`, points, units, asym)
|
const where = units => filter(original_where, `${name}.where`, points, units, asym)
|
||||||
|
|
||||||
const original_adjust = part.adjust // same as above
|
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, `${name}.expand`, units)
|
expand_shorthand(part, `${name}.expand`, units)
|
||||||
const expand = a.sane(part.expand || 0, `${name}.expand`, 'number')(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
|
// a prototype "shape" maker (and its units) are computed
|
||||||
const [shape_maker, shape_units] = whats[what](part, name, points, outlines, units)
|
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
|
// and then the shape is repeated for all where positions
|
||||||
for (const w of where(shape_units)) {
|
for (const w of where(shape_units)) {
|
||||||
|
|
|
@ -16,6 +16,12 @@ outlines:
|
||||||
where: true
|
where: true
|
||||||
size: cy
|
size: cy
|
||||||
bound: true
|
bound: true
|
||||||
|
adjust:
|
||||||
|
- what: circle
|
||||||
|
where: true
|
||||||
|
radius: 2
|
||||||
|
# adjust works, and it can use shape-specific units
|
||||||
|
adjust.shift: [0, r]
|
||||||
fillet:
|
fillet:
|
||||||
- name: base
|
- name: base
|
||||||
fillet: 2
|
fillet: 2
|
||||||
|
|
90
test/outlines/outlines___outlines_adjust_dxf.dxf
Normal file
90
test/outlines/outlines___outlines_adjust_dxf.dxf
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue