fix potential crash into stock when parts are z bottom anchored. fix fdm/cnc pmode check

This commit is contained in:
Stewart Allen 2022-05-16 22:42:07 -04:00
commit 0d9e549da4
2 changed files with 3 additions and 3 deletions

View file

@ -307,11 +307,11 @@ function prepEach(widget, settings, print, firstPoint, update) {
clearz = maxz; clearz = maxz;
// up if any point between higher than start/outline, go up first // up if any point between higher than start/outline, go up first
if (mustGoUp) { if (mustGoUp) {
layerPush(lastPoint.clone().setZ(clearz), 0, 0, tool.getNumber()); layerPush(lastPoint.clone().setZ(clearz + ztOff), 0, 0, tool.getNumber());
} }
// move to point above target point // move to point above target point
if (mustGoUp || point.z < maxz) { if (mustGoUp || point.z < maxz) {
layerPush(point.clone().setZ(clearz), 0, 0, tool.getNumber()); layerPush(point.clone().setZ(clearz + ztOff), 0, 0, tool.getNumber());
// new pos for plunge calc // new pos for plunge calc
deltaXY = 0; deltaXY = 0;
} }

View file

@ -239,7 +239,7 @@ function preparePreview(callback, scale = 1, offset = 0) {
const { device, process, controller } = settings; const { device, process, controller } = settings;
if (complete.preview === feature.pmode) { if (complete.preview === feature.pmode) {
if (device.extruders.length > 1) { if (device.extruders && device.extruders.length > 1) {
if (++feature.pmode > 2) { if (++feature.pmode > 2) {
feature.pmode = 1; feature.pmode = 1;
} }