fix rough and outline step down alignemnt to bottom

This commit is contained in:
Stewart Allen 2020-11-15 15:05:45 -05:00
commit 533b8035eb
3 changed files with 17 additions and 12 deletions

View file

@ -1,8 +1,6 @@
# Kiri:Moto todo
## 2.3 remaining
* adaptive shadow-line generation for small parts collision detection
* step down needs to go all the way to the bottom (always)
* add clear flats to roughing
* path arrows, retracts, and engages
* cap path ends
@ -61,6 +59,7 @@
* `B` outside cutting direction in roughing mode inverted
* `B` clear voids has double interior pass because wrong offset shadow used
* `B` fix contour up and over thru holes by adding (union) tabs to shadow
* `F` adaptive shadow-line generation for small parts collision detection
* `F` flat and volumetric rendering of paths
* `F` z bounded slices (extension of z bottom offset feature)
* `F` z planar settings visualizations

View file

@ -364,7 +364,6 @@
count++;
step = (zmax - zmin) / count;
}
if (opt.down) {
for (let i=0; i<count; i++) {
array.push(zmax);

View file

@ -165,7 +165,8 @@
maxToolDiam = Math.max(maxToolDiam, roughToolDiam);
let shadow = [];
let slices = [];
slicer.slice(slicer.interval(roughDown, { down: true, min: zBottom }), { each: (data, index, total) => {
const indices = slicer.interval(roughDown, { down: true, min: zBottom, fit: true });
slicer.slice(indices, { each: (data, index, total) => {
shadow = POLY.union(shadow.appendAll(data.tops), 0.01, true);
data.shadow = shadow.clone(true);
data.slice.camMode = PRO.ROUGH;
@ -240,13 +241,15 @@
if (!offset) return;
slice.camLines = offset;
// if (true) slice.output()
// .setLayer("top shadow", {line: 0x0000aa})
// .addPolys(tshadow)
// .setLayer("rough shadow", {line: 0x00aa00})
// .addPolys(shadow)
// .setLayer("rough shell", {line: 0xaa0000})
// .addPolys(shell);
if (true) slice.output()
.setLayer("slice", {line: 0xaaaa00}, true)
.addPolys(slice.topPolys())
// .setLayer("top shadow", {line: 0x0000aa})
// .addPolys(tshadow)
// .setLayer("rough shadow", {line: 0x00aa00})
// .addPolys(shadow)
// .setLayer("rough shell", {line: 0xaa0000})
// .addPolys(shell);
slice.output()
.setLayer("roughing", {face: 0, line: 0})
.addPolys(offset);
@ -265,7 +268,8 @@
let shadow = [];
let slices = [];
slicer.slice(slicer.interval(outlineDown, { down: true, min: zBottom }), { each: (data, index, total) => {
const indices = slicer.interval(outlineDown, { down: true, min: zBottom, fit: true });
slicer.slice(indices, { each: (data, index, total) => {
shadow = POLY.union(shadow.appendAll(data.tops), 0.01, true);
data.shadow = shadow.clone(true);
data.slice.camMode = PRO.OUTLINE;
@ -326,6 +330,9 @@
}
// offset.xout(`slice ${slice.z}`);
slice.camLines = offset;
if (true) slice.output()
.setLayer("slice", {line: 0xaaaa00}, true)
.addPolys(slice.topPolys())
slice.output()
.setLayer("outline", {face: 0, line: 0})
.addPolys(offset);