re-enable filter for the lathe op

This commit is contained in:
Stewart Allen 2023-03-08 20:45:35 -05:00
commit 85f7d77c08
4 changed files with 5 additions and 4 deletions

View file

@ -1364,7 +1364,7 @@ CAM.init = function(kiri, api) {
sep: UC.newBlank({class:"pop-sep"}),
tolerance: UC.newInput(LANG.ou_toll_s, {title:LANG.ou_toll_l, convert:UC.toFloat, bound:UC.bound(0,10.0), units:true, round:4}),
leave: UC.newInput(LANG.cf_leav_s, {title:LANG.cf_leav_l, convert:UC.toFloat, bound:UC.bound(0,100)}),
// filter: UC.newRow([ UC.newButton(LANG.filter, contourFilter) ], {class:"ext-buttons f-row"})
filter: UC.newRow([ UC.newButton(LANG.filter, contourFilter) ], {class:"ext-buttons f-row"})
};
function canDogBones() {

View file

@ -875,7 +875,7 @@ class OpLathe extends CamOp {
async slice(progress) {
let { op, state } = this;
let { addSlices } = state;
// let filter = createFilter(op);
let filter = createFilter(op);
this.topo = await CAM.Topo4({
op,
@ -884,7 +884,7 @@ class OpLathe extends CamOp {
progress(pct, msg);
},
ondone: (slices) => {
// slices = filter(slices);
slices = filter(slices);
this.slices = slices;
addSlices(slices, false);
}

View file

@ -1354,7 +1354,7 @@ function doSolidsFill(slice, spacing, angle, minArea, fillQ) {
// parent each solid polygon inside the smallest bounding top
let make_solid_layer = false;
let tops_area = tops.map(top => top.poly.areaDeep()).reduce((a,i) => a+i);
let tops_area = tops.length ? tops.map(top => top.poly.areaDeep()).reduce((a,i) => a+i) : 0;
for (let solid of solids) {
for (let top of tops) {
let stop = [];