fix contour cutting corners

This commit is contained in:
Stewart Allen 2021-03-06 15:26:41 -05:00
commit fcc247a4e0
2 changed files with 7 additions and 6 deletions

View file

@ -647,7 +647,8 @@
let { settings, widget } = state;
let { process } = settings;
let toolDiam = this.toolDiam;
let toolDiam = this.toolDiam = new CAM.Tool(settings, op.tool).fluteDiameter();
let stepover = toolDiam * op.step * 2;
let cutdir = process.camConventional;
let depthFirst = process.camDepthFirst;
let depthData = [];
@ -674,7 +675,7 @@
poly.reverse();
}
poly.forEachPoint(function(point, pidx) {
camOut(point.clone(), pidx > 0);
camOut(point.clone(), pidx > 0, stepover);
}, false);
});
newLayer();
@ -688,7 +689,7 @@
poly.reverse();
}
poly.forEachPoint(function(point, pidx) {
camOut(point.clone(), pidx > 0);
camOut(point.clone(), pidx > 0, stepover);
}, false);
newLayer();
return lastPoint();

View file

@ -231,7 +231,7 @@
);
}
function camOut(point, cut) {
function camOut(point, cut, moveLen = toolDiamMove) {
point = point.clone();
point.x += wmx;
point.y += wmy;
@ -264,7 +264,7 @@
}
// convert short planar moves to cuts in some cases
if (isMove && deltaXY <= toolDiamMove) {
if (isMove && deltaXY <= moveLen) {
let iscontour = tolerance > 0;
let isflat = absDeltaZ < 0.001;
// restrict this to contouring
@ -279,7 +279,7 @@
}
} else if (isMove) {
// for longer moves, check the terrain to see if we need to go up and over
const bigXY = (deltaXY > toolDiamMove);
const bigXY = (deltaXY > moveLen);
const bigZ = (deltaZ > toolDiam/2 && deltaXY > tolerance);
const midZ = (absDeltaZ >= tolerance);
if ((bigXY || bigZ) && (isMove || midZ)) {