more core slicer improvements for non-manifold objects

This commit is contained in:
Stewart Allen 2022-01-26 00:50:12 -05:00
commit 39f6b87dea
3 changed files with 73 additions and 30 deletions

View file

@ -721,18 +721,19 @@
});
if (slice.xray) {
const color = [ 0xff0000, 0x00aa00, 0x0000ff, 0xaaaa00, 0xff00ff ];
if (slice.lines) {
let dash = 5;
slice.lines.forEach((line, i) => {
const group = i % dash;
const color = [ 0xff0000, 0x00aa00, 0x0000ff, 0xaaaa00, 0xff00ff ][group];
slice.output().setLayer(`l${group}`, color).addLine(line.p1, line.p2);
const group = i % 5;
slice.output().setLayer(`l${group}`, color[group]).addLine(line.p1, line.p2);
});
}
if (slice.groups)
POLY.nest(slice.groups).forEach((poly, i) => {
const group = i % 5;
slice.addTop(poly);
slice.output().setLayer(`g${i}`, 0x888888).addPoly(poly);
// slice.output().setLayer(`g${i}`, 0x888888).addPoly(poly);
slice.output().setLayer(`g${i}`, color[group]).addPoly(poly);
});
}