thin fill checkpoint
This commit is contained in:
parent
cdfa2456e4
commit
1a73b9670d
1 changed files with 19 additions and 9 deletions
|
|
@ -405,6 +405,9 @@ var gs_kiri_slice = exports;
|
||||||
top.traces = last;
|
top.traces = last;
|
||||||
} else {
|
} else {
|
||||||
if (opt.thin) {
|
if (opt.thin) {
|
||||||
|
var sq2 = Math.sqrt(2),
|
||||||
|
ons2 = offset1 * sq2,
|
||||||
|
on2s2 = offsetN * sq2;
|
||||||
POLY.expand2(
|
POLY.expand2(
|
||||||
[top.poly],
|
[top.poly],
|
||||||
-offset1,
|
-offset1,
|
||||||
|
|
@ -425,15 +428,22 @@ var gs_kiri_slice = exports;
|
||||||
},
|
},
|
||||||
// thin wall probe
|
// thin wall probe
|
||||||
function(p1, p2, diff, dist) {
|
function(p1, p2, diff, dist) {
|
||||||
|
var ds2 = dist * sq2;
|
||||||
|
if (p2) {
|
||||||
|
// nth offset
|
||||||
var pall = POLY.nest(POLY.flatten([].appendAll(p1).appendAll(p2)).clone()),
|
var pall = POLY.nest(POLY.flatten([].appendAll(p1).appendAll(p2)).clone()),
|
||||||
pnew1 = POLY.expand(pall, -dist, z, null, 1),
|
pnew1 = POLY.expand(pall, -dist, z, null, 1),
|
||||||
r1 = fillArea(pnew1, 45, offsetN, [], 0, offset1),
|
r1 = fillArea(pnew1, 45, offsetN, [], ds2, on2s2),
|
||||||
r2 = fillArea(pnew1, 135, offsetN, [], 0, offset1),
|
r2 = fillArea(pnew1, 135, offsetN, [], dist, on2s2),
|
||||||
rall = top.thin_fill.appendAll(cullIntersections(r1, r2)),
|
|
||||||
pnew2 = POLY.expand(pnew1, -dist, z, null, 1),
|
|
||||||
r1 = fillArea(pnew2, 45, offsetN, [], 0, offset1),
|
|
||||||
r2 = fillArea(pnew2, 135, offsetN, [], 0, offset1),
|
|
||||||
rall = top.thin_fill.appendAll(cullIntersections(r1, r2));
|
rall = top.thin_fill.appendAll(cullIntersections(r1, r2));
|
||||||
|
} else {
|
||||||
|
// first offset
|
||||||
|
var pall = POLY.nest(POLY.flatten([].appendAll(p1).appendAll(p2)).clone()),
|
||||||
|
pnew1 = POLY.expand(pall, -dist, z, null, 1),
|
||||||
|
r1 = fillArea(pnew1, 45, offsetN, [], 0, ons2),
|
||||||
|
r2 = fillArea(pnew1, 135, offsetN, [], 0, ons2),
|
||||||
|
rall = top.thin_fill.appendAll(cullIntersections(r1, r2));
|
||||||
|
}
|
||||||
// top.thinner.appendAll(pnew1).appendAll(pnew2);
|
// top.thinner.appendAll(pnew1).appendAll(pnew2);
|
||||||
},
|
},
|
||||||
z);
|
z);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue