diff --git a/notes.md b/notes.md index 9cc78127..407fdbed 100644 --- a/notes.md +++ b/notes.md @@ -60,6 +60,7 @@ # CAM +* `B` increase tab height by z bottom * `B` prevent z delta cuts when not contouring * `B` climb vs conventional not fully consistent after refactor * `B` outside cutting direction in roughing mode inverted diff --git a/src/kiri/slicer2.js b/src/kiri/slicer2.js index 0a6b986b..debd1568 100644 --- a/src/kiri/slicer2.js +++ b/src/kiri/slicer2.js @@ -399,6 +399,13 @@ array.push(opt.down ? zmax : zmin); } + if (opt.flats && opt.off) { + // add over and under all flats by 'off' + array.appendAll(Object.keys(this.zFlat).map(v => parseFloat(v))).sort((a,b) => { + return opt.down ? b-a : a-b; + }); + } + return array.map(v => parseFloat(v.toFixed(2))); } } diff --git a/src/mode/cam/slice.js b/src/mode/cam/slice.js index 22ef3adc..8eae3408 100644 --- a/src/mode/cam/slice.js +++ b/src/mode/cam/slice.js @@ -121,7 +121,7 @@ }); let tslices = []; let tshadow = []; - let tzindex = slicer.interval(minStepDown, { fit: true, off: 0.01, down: true }); + let tzindex = slicer.interval(minStepDown, { fit: true, off: 0.01, down: true, flats: true }); let terrain = slicer.slice(tzindex, { each: (data, index, total) => { tshadow = POLY.union(tshadow.appendAll(data.tops), 0.01, true); tslices.push(data.slice); @@ -146,7 +146,7 @@ // create facing slices if (procFacing || proc.camRoughTop) { - let shadow = shadowTop.tops.clone(); + let shadow = tshadow.clone(); let inset = POLY.offset(shadow, (roughToolDiam / (procRoughIn ? 2 : 1))); let facing = POLY.offset(inset, -(roughToolDiam * proc.camRoughOver), { count: 999, flat: true }); let zdiv = ztOff / roughDown;