fix prep render bug (lastEnd) and contour camOut routing
This commit is contained in:
parent
394bfcf597
commit
42dfa27e63
3 changed files with 40 additions and 30 deletions
3
notes.md
3
notes.md
|
|
@ -3,7 +3,8 @@
|
||||||
## 2.3 remaining
|
## 2.3 remaining
|
||||||
* adaptive shadow-line generation for small parts collision detection
|
* adaptive shadow-line generation for small parts collision detection
|
||||||
* step down should interpolate top/bottom again
|
* step down should interpolate top/bottom again
|
||||||
* preview rendering bugs for contouring
|
* clear voids broken again
|
||||||
|
* fix contour up and over thru holes
|
||||||
* path arrows, retracts, and engages
|
* path arrows, retracts, and engages
|
||||||
* cap path ends
|
* cap path ends
|
||||||
* help dialog
|
* help dialog
|
||||||
|
|
|
||||||
|
|
@ -250,15 +250,18 @@
|
||||||
// new pos for plunge calc
|
// new pos for plunge calc
|
||||||
deltaXY = 0;
|
deltaXY = 0;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
// 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
|
||||||
if ((deltaXY > toolDiam || (deltaZ > toolDiam && deltaXY > tolerance)) && (isMove || absDeltaZ >= tolerance)) {
|
const bigXY = (deltaXY > toolDiam);
|
||||||
|
const bigZ = (deltaZ > toolDiam/2 && deltaXY > tolerance);
|
||||||
|
const midZ = (absDeltaZ >= tolerance);
|
||||||
|
if ((bigXY || bigZ) && (isMove || midZ)) {
|
||||||
let maxz = getZClearPath(
|
let maxz = getZClearPath(
|
||||||
terrain,
|
terrain,
|
||||||
lastPoint.x,// - wmx,
|
lastPoint.x,
|
||||||
lastPoint.y,// - wmy,
|
lastPoint.y,
|
||||||
point.x,// - wmx,
|
point.x,
|
||||||
point.y,// - wmy,
|
point.y,
|
||||||
Math.max(point.z, lastPoint.z),
|
Math.max(point.z, lastPoint.z),
|
||||||
zadd,
|
zadd,
|
||||||
maxToolDiam/2,
|
maxToolDiam/2,
|
||||||
|
|
@ -268,7 +271,9 @@
|
||||||
clearz = maxz;
|
clearz = maxz;
|
||||||
// up if any point between higher than start/outline, go up
|
// up if any point between higher than start/outline, go up
|
||||||
if (mustGoUp) {
|
if (mustGoUp) {
|
||||||
clearz = maxz + zclear;
|
if (bigXY) {
|
||||||
|
clearz += zclear;
|
||||||
|
}
|
||||||
layerPush(lastPoint.clone().setZ(clearz), 0, 0, tool.getNumber());
|
layerPush(lastPoint.clone().setZ(clearz), 0, 0, tool.getNumber());
|
||||||
}
|
}
|
||||||
// move to point above target point
|
// move to point above target point
|
||||||
|
|
@ -278,6 +283,7 @@
|
||||||
deltaXY = 0;
|
deltaXY = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// synth new plunge rate
|
// synth new plunge rate
|
||||||
if (deltaZ <= -tolerance) {
|
if (deltaZ <= -tolerance) {
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,7 @@
|
||||||
self.worker.print.thinColor = thin;
|
self.worker.print.thinColor = thin;
|
||||||
self.worker.print.flatColor = flat;
|
self.worker.print.flatColor = flat;
|
||||||
|
|
||||||
|
let lastEnd = null;
|
||||||
let lastOut = null;
|
let lastOut = null;
|
||||||
let current = null;
|
let current = null;
|
||||||
|
|
||||||
|
|
@ -462,7 +463,7 @@
|
||||||
let width = 1;
|
let width = 1;
|
||||||
let emits = 0;
|
let emits = 0;
|
||||||
|
|
||||||
level.forEach(out => {
|
level.forEach((out,oi) => {
|
||||||
if (!out.point) {
|
if (!out.point) {
|
||||||
// in cam mode, these are drilling or dwell ops
|
// in cam mode, these are drilling or dwell ops
|
||||||
return;
|
return;
|
||||||
|
|
@ -472,7 +473,7 @@
|
||||||
const op = out.point, lp = lastOut.point,
|
const op = out.point, lp = lastOut.point,
|
||||||
moved = (op.x !== lp.x) || (op.y !== lp.y) || (op.z !== lp.z);;
|
moved = (op.x !== lp.x) || (op.y !== lp.y) || (op.z !== lp.z);;
|
||||||
if (out.emit) {
|
if (out.emit) {
|
||||||
if (!lastOut.emit || (ckspeed && out.speed !== lastOut.speed)) {
|
if (!lastOut.emit || (ckspeed && out.speed !== lastOut.speed) || lastEnd) {
|
||||||
current = newPolygon().setOpen();
|
current = newPolygon().setOpen();
|
||||||
current.push(lastOut.point);
|
current.push(lastOut.point);
|
||||||
current.color = color(out);
|
current.color = color(out);
|
||||||
|
|
@ -480,13 +481,14 @@
|
||||||
}
|
}
|
||||||
current.push(out.point);
|
current.push(out.point);
|
||||||
} else {
|
} else {
|
||||||
if (lastOut.emit) {
|
if (lastOut.emit || lastEnd) {
|
||||||
current = newPolygon().setOpen();
|
current = newPolygon().setOpen();
|
||||||
current.push(lastOut.point);
|
current.push(lastOut.point);
|
||||||
moves.push(current);
|
moves.push(current);
|
||||||
}
|
}
|
||||||
current.push(out.point);
|
current.push(out.point);
|
||||||
}
|
}
|
||||||
|
lastEnd = null;
|
||||||
} else {
|
} else {
|
||||||
current = newPolygon().setOpen();
|
current = newPolygon().setOpen();
|
||||||
current.push(out.point);
|
current.push(out.point);
|
||||||
|
|
@ -503,6 +505,7 @@
|
||||||
if (lastOut.emit && !emits) {
|
if (lastOut.emit && !emits) {
|
||||||
pushPrint(lastOut.tool, current)
|
pushPrint(lastOut.tool, current)
|
||||||
}
|
}
|
||||||
|
lastEnd = lastOut;
|
||||||
output
|
output
|
||||||
.setLayer(opts.other || 'move', moveOpt, opts.moves !== true)
|
.setLayer(opts.other || 'move', moveOpt, opts.moves !== true)
|
||||||
.addPolys(moves, { thin: true, z: opts.z });
|
.addPolys(moves, { thin: true, z: opts.z });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue