diff --git a/src/kiri/layers.js b/src/kiri/layers.js index 0f3c9f98..caa7ec8e 100644 --- a/src/kiri/layers.js +++ b/src/kiri/layers.js @@ -232,7 +232,7 @@ } } } else { - cur.paths.push({ index, faces, z: poly.getZ() }); + cur.paths.push({ index, faces, z: opts.z || poly.getZ() }); if (opts.color) { cur.cpath = [ Object.assign({ start: 0, count: Infinity }, opts.color) ]; } diff --git a/src/mode/fdm/client.js b/src/mode/fdm/client.js index d209722f..46c9e9cd 100644 --- a/src/mode/fdm/client.js +++ b/src/mode/fdm/client.js @@ -35,7 +35,7 @@ restoreSupports(api.widgets.all()); }); api.event.on("settings.saved", (settings) => { - api.ui.fdmSupport.style.display = lastMode === 'CAM' || settings.device.bedBelt ? 'none' : 'flex'; + api.ui.fdmSupport.style.display = lastMode !== 'FDM' || settings.device.bedBelt ? 'none' : 'flex'; }); api.event.on("button.click", target => { switch (target) { diff --git a/src/mode/fdm/prepare.js b/src/mode/fdm/prepare.js index 6bf62b47..f2bc0da7 100644 --- a/src/mode/fdm/prepare.js +++ b/src/mode/fdm/prepare.js @@ -520,14 +520,13 @@ return currentColorFunction(rate/max, 1, 0.85); }; - FDM.prepareRender = function(levels, update, options) { + FDM.prepareRender = function(levels, update, opts = {}) { levels = levels.filter(level => level.length); if (levels.length === 0) { self.worker.print.maxSpeed = 0; return []; } - const opts = options || {}; const tools = opts.tools || {}; const flat = opts.flat; const thin = opts.thin && !flat; @@ -675,6 +674,10 @@ output .setLayer(opts.other || 'move', moveOpt, opts.moves !== true) .addPolys(moves, { thin: true, z: opts.z }); + // force level when present + if (level.z) { + opts.z = level.z; + } Object.values(prints).forEach(array => { array.forEach(poly => { if (flat && poly.appearsClosed()) {