add low level slice debugging

This commit is contained in:
Stewart Allen 2021-07-04 18:42:00 -04:00
commit 52b19ff04f
2 changed files with 69 additions and 39 deletions

View file

@ -185,7 +185,7 @@
firstHeight: sliceHeightBase,
// support/synth usually has overlapping boxes
union: controller.healMesh || isSynth,
indices: process.indices,
indices: process.indices || process.xray,
concurrent: isConcurrent,
post: {
shellOffset,
@ -196,10 +196,9 @@
isSynth,
process,
isDanger
}
// debug: true,
// view: view,
// xray: 3,
},
xray: process.xray,
debug: process.xray
}, slices => {
onSliceDone(slices).then(ondone);
}, update => {
@ -641,6 +640,24 @@
.addLines(poly.fill, vopt({ offset, height }));
});
if (slice.xray) {
if (slice.lines) {
let dash = 3;
slice.lines.forEach((line, i) => {
const group = i % dash;
const color = [ 0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff ][group];
slice.output().setLayer(`xl-${group}`, color).addLine(line.p1, line.p2);
});
}
if (slice.groups)
POLY.nest(slice.groups).forEach((poly, i) => {
slice.addTop(poly);
const group = i % 3;
const color = [ 0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff ][group];
slice.output().setLayer(`xg-${group}`, color).addPoly(poly);
});
}
// console.log(slice.index, slice.render.stats);
}