fix inside tabs. add tabs to shadow so moves always avoid them

This commit is contained in:
Stewart Allen 2020-11-28 00:07:38 -05:00
commit 8a29428f78
2 changed files with 23 additions and 7 deletions

View file

@ -23,7 +23,6 @@
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
* `F` image import borders
* `F` mesh / stl export (like w/ images, rotate, scale, future cleanup ops)
* `F` detect and report slow framerates
* `F` right click / context menu (object deletion, etc)
@ -72,6 +71,7 @@
* `B` outside cutting direction in roughing mode inverted
* `B` clear voids has double interior pass because wrong offset shadow used
* `B` top clearing operations should use linear, not offset, passes
* `F` animation should clear the mesh in areas where the cuts go through the stock?
* `F` switch z top offset to an z anchor (top/bottom) + offset
* `F` use 3 registration holes to prevent rotation accidents (midline offset one axis)
* `F` parameterize dropping close points in prep.js. ensure long segments remain straight

View file

@ -306,15 +306,16 @@
const outside = POLY.offset(shadow.clone(), roughToolDiam * proc.camRoughOver, {z: slice.z});
if (outside) {
offset.appendAll(outside);
if (tabs) {
tabs.forEach(tab => {
tab.off = POLY.expand([tab.poly], roughToolDiam / 2).flat();
});
offset = cutTabs(tabs, offset, slice.z);
}
}
}
if (tabs) {
tabs.forEach(tab => {
tab.off = POLY.expand([tab.poly], roughToolDiam / 2).flat();
});
offset = cutTabs(tabs, offset, slice.z);
}
if (!offset) return;
slice.camLines = offset;
@ -477,6 +478,21 @@
sliceAll.forEach((slice, index) => slice.index = index);
// used in printSetup()
// used in CAM.prepare.getZClearPath()
// add tabs to terrain tops so moves avoid them
if (tabs) {
terrain.forEach(slab => {
tabs.forEach(tab => {
if (tab.pos.z + tab.dim.z/2 >= slab.z) {
let all = [...slab.tops, tab.poly];
slab.tops = POLY.union(all, 0, true);
// slab.slice.output()
// .setLayer("debug-tabs", {line: 0x880088, thin: true })
// .addPolys(POLY.setZ(slab.tops.clone(true), slab.z), { thin: true });
}
});
});
}
widget.terrain = terrain;
widget.maxToolDiam = maxToolDiam;