change slice bounds errors into alerts
This commit is contained in:
parent
1f6314512c
commit
604af6ff1f
1 changed files with 8 additions and 4 deletions
|
|
@ -119,6 +119,10 @@ export async function cam_slice(settings, widget, onupdate, ondone) {
|
||||||
ondone(msg);
|
ondone(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function alert(msg) {
|
||||||
|
onupdate(null,null,msg);
|
||||||
|
}
|
||||||
|
|
||||||
if (unsafe) {
|
if (unsafe) {
|
||||||
console.log("disabling overhang safeties");
|
console.log("disabling overhang safeties");
|
||||||
}
|
}
|
||||||
|
|
@ -135,20 +139,20 @@ export async function cam_slice(settings, widget, onupdate, ondone) {
|
||||||
let maxDelta = 1e-3;
|
let maxDelta = 1e-3;
|
||||||
|
|
||||||
if (stock.x + maxDelta < (bounds.max.x - bounds.min.x)) {
|
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)) {
|
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)) {
|
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) {
|
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();
|
let mark = Date.now();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue