Allow outline adjusts to use shape-specific units

This commit is contained in:
Bán Dénes 2023-05-31 11:01:43 +02:00
parent 14cd499182
commit e924352763
3 changed files with 97 additions and 1 deletions

View file

@ -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)) {

View file

@ -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

View 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