From 905f0392f656502c2de1a5151b712868b9a9c114 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 14 Feb 2023 22:35:08 -0500 Subject: [PATCH] fix force z max condition that could cause part collision --- src/kiri-mode/cam/prepare.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kiri-mode/cam/prepare.js b/src/kiri-mode/cam/prepare.js index 47d3f383..52c3da03 100644 --- a/src/kiri-mode/cam/prepare.js +++ b/src/kiri-mode/cam/prepare.js @@ -371,11 +371,12 @@ function prepEach(widget, settings, print, firstPoint, update) { maxZdelta = Math.max(maxz - point.z, maxz - lastPoint.z), mustGoUp = maxZdelta >= tolerance, clearz = maxz; + let zIsBelow = point.z <= maxz; if (zmax_force) { clearz = maxz = zmax + zadd; + zIsBelow = true; } // up if any point between higher than start/outline, go up first - const zIsBelow = point.z <= maxz; if (mustGoUp || zIsBelow) { const zClearance = clearz + ztOff; if (zIsBelow) {