rename and comment top and noodle fields
This commit is contained in:
parent
91ad27f540
commit
5a71b25cdb
3 changed files with 8 additions and 8 deletions
|
|
@ -265,23 +265,23 @@ class Polygon {
|
|||
// inset outer polygon
|
||||
let inner = this.inner;
|
||||
let inset = this.clone().offset(width);
|
||||
let noodle = [ this.clone().setInner(inset) ];
|
||||
let noodot = [ this.clone().setInner(inset) ];
|
||||
let noodin = [];
|
||||
// subtract inners from the inset
|
||||
if (inner) {
|
||||
noodle = POLY.subtract(noodle, inner, []);
|
||||
noodot = POLY.subtract(noodot, inner, []);
|
||||
// for each inner, offset and subtract noodle + itself
|
||||
let nood = [];
|
||||
for (let innie of inner) {
|
||||
let inexp = innie.clone().offset(-width);
|
||||
let intrm = POLY.trimTo(inexp, [ this ]);
|
||||
let inood = POLY.subtract(intrm, [ ...noodle, innie ], []);
|
||||
let inood = POLY.subtract(intrm, [ ...noodot, innie ], []);
|
||||
nood.push(...inood);
|
||||
}
|
||||
noodin = POLY.union(nood, 0, true);
|
||||
}
|
||||
// unify inner noodles and outer noodle
|
||||
noodle = POLY.union([ ...noodle, ...noodin ], 0, true);
|
||||
let noodle = POLY.union([ ...noodot, ...noodin ], 0, true);
|
||||
// subtract noodle from poly for next noodle calc
|
||||
let remain = POLY.subtract([ this ], noodle, []);
|
||||
return { noodle, remain };
|
||||
|
|
|
|||
Loading…
Reference in a new issue