Allow glue opt-out, even when bound
This commit is contained in:
parent
c46a0bcd16
commit
21cfc1fd35
3 changed files with 159 additions and 2 deletions
|
@ -135,8 +135,13 @@ const layout = exports._layout = (config = {}, points = {}, units = {}) => {
|
||||||
if (side == 'left') return left
|
if (side == 'left') return left
|
||||||
if (side == 'right') return right
|
if (side == 'right') return right
|
||||||
|
|
||||||
|
// allow opting out of gluing, when
|
||||||
|
// A) there are no glue definitions, or
|
||||||
|
// B) glue is explicitly set to false
|
||||||
|
const glue_opt_out = (!Object.keys(parsed_glue).length || params.glue === false)
|
||||||
|
|
||||||
let glue = {models: {}}
|
let glue = {models: {}}
|
||||||
if (bound && ['middle', 'both', 'glue'].includes(side)) {
|
if (bound && ['middle', 'both', 'glue'].includes(side) && !glue_opt_out) {
|
||||||
|
|
||||||
const default_glue_name = Object.keys(parsed_glue)[0]
|
const default_glue_name = Object.keys(parsed_glue)[0]
|
||||||
const computed_glue_name = a.sane(params.glue || default_glue_name, `${export_name}.glue`, 'string')()
|
const computed_glue_name = a.sane(params.glue || default_glue_name, `${export_name}.glue`, 'string')()
|
||||||
|
|
|
@ -41,4 +41,10 @@ outlines:
|
||||||
side: both
|
side: both
|
||||||
bound: false
|
bound: false
|
||||||
size: 14
|
size: 14
|
||||||
operation: subtract
|
operation: subtract
|
||||||
|
optout:
|
||||||
|
main:
|
||||||
|
type: keys
|
||||||
|
side: both
|
||||||
|
size: 20
|
||||||
|
glue: false
|
146
test/outlines/gluing___outlines_optout_dxf.dxf
Normal file
146
test/outlines/gluing___outlines_optout_dxf.dxf
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
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
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
-12.8171276
|
||||||
|
20
|
||||||
|
-5.9767248
|
||||||
|
11
|
||||||
|
23.8308846
|
||||||
|
21
|
||||||
|
-19.3155103
|
||||||
|
0
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
-12.8171276
|
||||||
|
20
|
||||||
|
-5.9767248
|
||||||
|
11
|
||||||
|
0.5216579
|
||||||
|
21
|
||||||
|
30.6712874
|
||||||
|
0
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
0.5216579
|
||||||
|
20
|
||||||
|
30.6712874
|
||||||
|
11
|
||||||
|
37.1696701
|
||||||
|
21
|
||||||
|
17.3325019
|
||||||
|
0
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
23.8308846
|
||||||
|
20
|
||||||
|
-19.3155103
|
||||||
|
11
|
||||||
|
37.1696701
|
||||||
|
21
|
||||||
|
17.3325019
|
||||||
|
0
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
54.8742004
|
||||||
|
20
|
||||||
|
-19.3155103
|
||||||
|
11
|
||||||
|
91.5222126
|
||||||
|
21
|
||||||
|
-5.9767248
|
||||||
|
0
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
78.1834271
|
||||||
|
20
|
||||||
|
30.6712874
|
||||||
|
11
|
||||||
|
91.5222126
|
||||||
|
21
|
||||||
|
-5.9767248
|
||||||
|
0
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
41.5354149
|
||||||
|
20
|
||||||
|
17.3325019
|
||||||
|
11
|
||||||
|
78.1834271
|
||||||
|
21
|
||||||
|
30.6712874
|
||||||
|
0
|
||||||
|
LINE
|
||||||
|
8
|
||||||
|
0
|
||||||
|
10
|
||||||
|
41.5354149
|
||||||
|
20
|
||||||
|
17.3325019
|
||||||
|
11
|
||||||
|
54.8742004
|
||||||
|
21
|
||||||
|
-19.3155103
|
||||||
|
0
|
||||||
|
ENDSEC
|
||||||
|
0
|
||||||
|
EOF
|
Loading…
Add table
Add a link
Reference in a new issue