checkpoint trace work. wide cutout now does interiors

This commit is contained in:
Stewart Allen 2020-11-30 00:19:28 -05:00
commit 7777ea6932
7 changed files with 63 additions and 41 deletions

View file

@ -49,13 +49,13 @@
api.event.on("settings.saved", (settings) => {
const proc = settings.process;
// show/hide dots in enabled process pop buttons
// api.ui.camTabs.marker.style.display = proc.camTabsOn ? 'flex' : 'none';
api.ui.camRough.marker.style.display = proc.camRoughOn ? 'flex' : 'none';
api.ui.camDrill.marker.style.display =
proc.camDrillingOn || proc.camDrillReg !== 'none' ? 'flex' : 'none';
api.ui.camOutline.marker.style.display = proc.camOutlineOn ? 'flex' : 'none';
api.ui.camContour.marker.style.display =
proc.camContourXOn || proc.camContourYOn ? 'flex' : 'none';
api.ui.camTracing.marker.style.display = proc.camTraceOn ? 'flex' : 'none';
updateStock(settings, 'settings.saved.internal');
});

View file

@ -438,7 +438,7 @@
offset.slice().forEach(op => {
// clone removes inners but the real solution is
// to limit expanded shells to through holes
POLY.expand([op.clone()], outlineToolDiam * 0.5, slice.z, offset, 1);
POLY.expand([op.clone(true)], outlineToolDiam * 0.5, slice.z, offset, 1);
});
}
}
@ -484,13 +484,30 @@
}
// prepare for tracing paths
let traceTool;
let traceToolProfile;
if (procTrace) {
traceTool = getToolById(conf, proc.camTraceTool);
if (traceTool.type !== 'endmill') {
traceToolProfile = createToolProfile(conf, proc.camTraceTool, widget.topo);
}
let traceTool = new CAM.Tool(conf, proc.camTraceTool);
let traceToolDiam = traceTool.fluteDiameter();
maxToolDiam = Math.max(maxToolDiam, traceToolDiam);
// unique merge of z flats and z line indices
let indices = [...new Set(Object.keys(slicer.zFlat)
.map(kv => parseFloat(kv).round(5))
.appendAll(Object.entries(slicer.zLine).map(ze => {
let [ zk, zv ] = ze;
return zv > 0 ? parseFloat(zk).round(5) : null;
})
.filter(v => v !== null)))]
.sort((a,b) => b - a);
let slices = [];
slicer.slice(indices, { each: (data, index, total) => {
let slice = data.slice;
slice.camMode = PRO.TRACE;
slices.push(slice);
sliceAll.append(slice);
if (true) slice.output()
.setLayer("trace", {line: 0x88aa55}, false)
.addPolys(slice.topPolys())
updateOp(index, total);
}, genso: true, emptyok: true, flatoff: 0, edges: true, openok: true });
}
if (procDrill) {