complete threading support for all slicing ops. add pocket surface selection criteria

This commit is contained in:
Stewart Allen 2023-01-15 16:36:05 -05:00
commit fa6d07ed15
9 changed files with 62 additions and 27 deletions

View file

@ -333,13 +333,13 @@ CAM.traces = async function(settings, widget, single) {
let slicer = new kiri.cam_slicer(widget);
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 > 1 ? parseFloat(zk).round(5) : null;
})
.filter(v => v !== null)))]
// .appendAll(Object.entries(slicer.zLine).map(ze => {
// let [ zk, zv ] = ze;
// return zv > 1 ? parseFloat(zk).round(5) : null;
// })
// .filter(v => v !== null))
)]
.sort((a,b) => b - a);
let traces = [];
// find and trim polys (including open) to shadow
let oneach = data => {
@ -369,8 +369,9 @@ CAM.traces = async function(settings, widget, single) {
traces.push(poly);
});
};
let opts = { each: oneach, over: false, flatoff: 0, edges: true, openok: true };
let opts = { each: oneach, over: false, flatoff: 0, edges: true, openok: true, lines: true };
await slicer.slice(indices, opts);
// pick up bottom features
opts.over = true;
await slicer.slice(indices, opts);
widget.traces = traces;