diff --git a/src/kiri/core/widget.js b/src/kiri/core/widget.js index 3e340433..783598ca 100644 --- a/src/kiri/core/widget.js +++ b/src/kiri/core/widget.js @@ -360,6 +360,10 @@ class Widget { this.setOpacity(opacity ?? 1); } + refreshVisualState() { + this.setVisualState(this.getVisualState()); + } + restoreVisualState() { if (this.cache.vizstate) { this.setVisualState(this.cache.vizstate); @@ -613,6 +617,7 @@ class Widget { this.roto = []; this.center(); this.setModified(); + this.refreshVisualState(); } mirror() { diff --git a/src/kiri/mode/cam/slice.js b/src/kiri/mode/cam/slice.js index 0d8f884d..2c9f454f 100644 --- a/src/kiri/mode/cam/slice.js +++ b/src/kiri/mode/cam/slice.js @@ -132,15 +132,17 @@ export async function cam_slice(settings, widget, onupdate, ondone) { } if (stock.x && stock.y && stock.z && !isIndexed) { - if (stock.x + 0.00001 < bounds.max.x - bounds.min.x) { + 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'); } - if (stock.y + 0.00001 < 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'); } - if (stock.z + 0.00001 < 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'); } }