fix contour cutting corners
This commit is contained in:
parent
423ad7064d
commit
fcc247a4e0
2 changed files with 7 additions and 6 deletions
|
|
@ -647,7 +647,8 @@
|
||||||
let { settings, widget } = state;
|
let { settings, widget } = state;
|
||||||
let { process } = settings;
|
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 cutdir = process.camConventional;
|
||||||
let depthFirst = process.camDepthFirst;
|
let depthFirst = process.camDepthFirst;
|
||||||
let depthData = [];
|
let depthData = [];
|
||||||
|
|
@ -674,7 +675,7 @@
|
||||||
poly.reverse();
|
poly.reverse();
|
||||||
}
|
}
|
||||||
poly.forEachPoint(function(point, pidx) {
|
poly.forEachPoint(function(point, pidx) {
|
||||||
camOut(point.clone(), pidx > 0);
|
camOut(point.clone(), pidx > 0, stepover);
|
||||||
}, false);
|
}, false);
|
||||||
});
|
});
|
||||||
newLayer();
|
newLayer();
|
||||||
|
|
@ -688,7 +689,7 @@
|
||||||
poly.reverse();
|
poly.reverse();
|
||||||
}
|
}
|
||||||
poly.forEachPoint(function(point, pidx) {
|
poly.forEachPoint(function(point, pidx) {
|
||||||
camOut(point.clone(), pidx > 0);
|
camOut(point.clone(), pidx > 0, stepover);
|
||||||
}, false);
|
}, false);
|
||||||
newLayer();
|
newLayer();
|
||||||
return lastPoint();
|
return lastPoint();
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function camOut(point, cut) {
|
function camOut(point, cut, moveLen = toolDiamMove) {
|
||||||
point = point.clone();
|
point = point.clone();
|
||||||
point.x += wmx;
|
point.x += wmx;
|
||||||
point.y += wmy;
|
point.y += wmy;
|
||||||
|
|
@ -264,7 +264,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert short planar moves to cuts in some cases
|
// convert short planar moves to cuts in some cases
|
||||||
if (isMove && deltaXY <= toolDiamMove) {
|
if (isMove && deltaXY <= moveLen) {
|
||||||
let iscontour = tolerance > 0;
|
let iscontour = tolerance > 0;
|
||||||
let isflat = absDeltaZ < 0.001;
|
let isflat = absDeltaZ < 0.001;
|
||||||
// restrict this to contouring
|
// restrict this to contouring
|
||||||
|
|
@ -279,7 +279,7 @@
|
||||||
}
|
}
|
||||||
} else if (isMove) {
|
} else if (isMove) {
|
||||||
// for longer moves, check the terrain to see if we need to go up and over
|
// 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 bigZ = (deltaZ > toolDiam/2 && deltaXY > tolerance);
|
||||||
const midZ = (absDeltaZ >= tolerance);
|
const midZ = (absDeltaZ >= tolerance);
|
||||||
if ((bigXY || bigZ) && (isMove || midZ)) {
|
if ((bigXY || bigZ) && (isMove || midZ)) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue