fix zadd for first point and transits. also fix drill first point

This commit is contained in:
Stewart Allen 2020-07-17 18:14:55 -04:00
commit 931a14dc81

View file

@ -1395,7 +1395,7 @@
} }
points.forEach(function(point, index) { points.forEach(function(point, index) {
camOut(point, 1); camOut(point, 1);
if (index < points.length - 1) { if (index > 0 && index < points.length - 1) {
if (dwell) camDwell(dwell); if (dwell) camDwell(dwell);
if (lift) camOut(point.clone().setZ(point.z + lift), 0); if (lift) camOut(point.clone().setZ(point.z + lift), 0);
} }
@ -1437,7 +1437,7 @@
let rate = feedRate; let rate = feedRate;
if (!lastPoint) { if (!lastPoint) {
let above = point.clone().setZ(zmax); let above = point.clone().setZ(zmax + zadd);
// before first point, move cutting head to point above it // before first point, move cutting head to point above it
layerPush(above, 0, 0, tool.number); layerPush(above, 0, 0, tool.number);
// then set that as the lastPoint // then set that as the lastPoint
@ -1474,9 +1474,9 @@
lastPoint.x - wmx, lastPoint.x - wmx,
lastPoint.y - wmy, lastPoint.y - wmy,
point.x - wmx, point.x - wmx,
point.y - wmy) + zadd, point.y - wmy),
point.z, point.z,
lastPoint.z) : zmax) + ztoff, lastPoint.z) : zmax) + ztoff + zadd,
mustGoUp = Math.max(maxz - point.z, maxz - lastPoint.z) >= tolerance, mustGoUp = Math.max(maxz - point.z, maxz - lastPoint.z) >= tolerance,
clearz = maxz; clearz = maxz;
// up if any point between higher than start/outline // up if any point between higher than start/outline