From 604af6ff1f2ae3ad82a6079a1fb5c7cb8f5cc392 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sat, 22 Nov 2025 11:21:32 -0500 Subject: [PATCH] change slice bounds errors into alerts --- src/kiri/mode/cam/slice.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/kiri/mode/cam/slice.js b/src/kiri/mode/cam/slice.js index a549505f..ed3a541c 100644 --- a/src/kiri/mode/cam/slice.js +++ b/src/kiri/mode/cam/slice.js @@ -119,6 +119,10 @@ export async function cam_slice(settings, widget, onupdate, ondone) { ondone(msg); } + function alert(msg) { + onupdate(null,null,msg); + } + if (unsafe) { console.log("disabling overhang safeties"); } @@ -135,20 +139,20 @@ export async function cam_slice(settings, widget, onupdate, ondone) { let maxDelta = 1e-3; if (stock.x + maxDelta < (bounds.max.x - bounds.min.x)) { - return error('stock X too small for part. resize stock or use offset stock'); + alert('stock X too small for part'); } if (stock.y + maxDelta < (bounds.max.y - bounds.min.y)) { - return error('stock Y too small for part. resize stock or use offset stock'); + alert('stock Y too small for part'); } if (stock.z + maxDelta < (bounds.max.z - bounds.min.z)) { - return error('stock Z too small for part. resize stock or use offset stock'); + alert('stock Z too small for part'); } } if (zMin >= bounds.max.z) { - return error(`invalid z bottom ${(zMin / units).round(3)} >= bounds z max ${(zMax / units).round(3)}`); + alert(`invalid z bottom ${(zMin / units).round(3)} >= bounds z max ${(zMax / units).round(3)}`); } let mark = Date.now();