fix recursive uee of and nested travel boundaries
This commit is contained in:
parent
8bca0a949a
commit
ba0a4a16ab
2 changed files with 5 additions and 4 deletions
|
|
@ -27,7 +27,7 @@ class OpShadow extends CamOp {
|
|||
|
||||
async slice(progress) {
|
||||
let state = this.state;
|
||||
let { addSlices, settings, shadowAt, unsafe, widget } = state;
|
||||
let { addSlices, settings, shadowAt, unsafe, widget, workarea } = state;
|
||||
let { devel } = settings.controller;
|
||||
|
||||
let bounds = widget.getBoundingBox();
|
||||
|
|
@ -36,10 +36,12 @@ class OpShadow extends CamOp {
|
|||
let skipTerrain = unsafe;
|
||||
let terrain = [];
|
||||
let tzindex = [];
|
||||
let { bottom_z, top_z } = workarea;
|
||||
|
||||
let minZ = Math.floor(bounds.min.z);
|
||||
let maxZ = Math.floor(bounds.max.z);
|
||||
for (let z = maxZ; z >= minZ; z--) {
|
||||
// if (z <= top_z && z >= bottom_z)
|
||||
tzindex.push(z);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -542,7 +542,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
|
|||
}
|
||||
|
||||
function setTravelBoundary(polys) {
|
||||
travelBounds = polys;
|
||||
travelBounds = POLY.flatten(polys);
|
||||
}
|
||||
|
||||
function clearTravelBoundary() {
|
||||
|
|
@ -610,8 +610,6 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
|
|||
flat = flat.filter(p => p.isNested(inside));
|
||||
}
|
||||
|
||||
setTravelBoundary(tops.tool_shadow);
|
||||
|
||||
for (;;) {
|
||||
let wpp = getWidgetPrintPoint();
|
||||
let poly = flat.filter(poly => !poly.marked)
|
||||
|
|
@ -621,6 +619,7 @@ export async function prepare_one(widget, settings, print, firstPoint, update) {
|
|||
|
||||
if (poly) {
|
||||
let output = [];
|
||||
setTravelBoundary(tops.tool_shadow);
|
||||
emit_flat([ poly ], output);
|
||||
for (let poly of output) {
|
||||
polyEmit(poly, CLOSEST_TO_PP);
|
||||
|
|
|
|||
Loading…
Reference in a new issue