From 75fc39b54576d16e264e5151c935c20adf4208b1 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 31 Oct 2022 19:12:41 -0400 Subject: [PATCH] align FDM top/bottom layer options with convention --- release.md | 1 + src/cli/kiri-fdm-process.json | 1 - src/kiri-mode/fdm/slice.js | 12 +++++++----- src/kiri/conf.js | 1 - src/kiri/init.js | 1 - web/kiri/engine.html | 1 - web/kiri/lang/en.js | 4 ++-- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/release.md b/release.md index 15662db5..ea84f245 100644 --- a/release.md +++ b/release.md @@ -4,6 +4,7 @@ Full docs @ https://docs.grid.space/projects/kiri-moto # Release 3.7 +* align FDM top/bottom layer options with convention * add Mesh:Tool SVG import options for extrusion depth and boolean repair * replace jscad/modeling with Manifold project for faster mesh boolean * various CAM gcode, preview, animation fixes (3 axis) diff --git a/src/cli/kiri-fdm-process.json b/src/cli/kiri-fdm-process.json index 8bf687c4..dc25f474 100644 --- a/src/cli/kiri-fdm-process.json +++ b/src/cli/kiri-fdm-process.json @@ -21,7 +21,6 @@ "sliceSupportAngle": 50, "sliceSupportNozzle": 0, "sliceSolidMinArea": 1, - "sliceSolidLayers": 3, "sliceBottomLayers": 3, "sliceTopLayers": 3, "firstLayerRate": 10, diff --git a/src/kiri-mode/fdm/slice.js b/src/kiri-mode/fdm/slice.js index fd25ee01..e6216468 100644 --- a/src/kiri-mode/fdm/slice.js +++ b/src/kiri-mode/fdm/slice.js @@ -104,7 +104,9 @@ FDM.slice = function(settings, widget, onupdate, ondone) { isDanger = controller.danger, useAssembly = controller.assembly, isConcurrent = controller.threaded && kiri.minions.concurrent, + topLayers = process.sliceTopLayers || 0, solidLayers = process.sliceSolidLayers || 0, + bottomLayers = process.sliceBottomLayers || 0, vaseMode = process.sliceFillType === 'vase' && !isSynth, metadata = widget.anno, maxtruder = Math.max(0, device.extruders.length - 1), @@ -472,8 +474,8 @@ FDM.slice = function(settings, widget, onupdate, ondone) { forSlices(0.15, 0.2, slice => { let range = slice.params; let spaceMult = slice.index === 0 ? process.firstLayerLineMult || 1 : 1; - let isBottom = slice.index < process.sliceBottomLayers; - let isTop = process.sliceTopLayers && slice.index > slices.length - process.sliceTopLayers - 1; + let isBottom = slice.index < bottomLayers; + let isTop = topLayers && slice.index > slices.length - topLayers - 1; let isDense = range.sliceFillSparse > 0.995; let isSolid = (isBottom || ((isTop || isDense) && !vaseMode)) && !isSynth; let solidWidth = isSolid ? range.sliceFillWidth || 1 : 0; @@ -692,7 +694,7 @@ FDM.slice = function(settings, widget, onupdate, ondone) { // layer boolean diffs need to be computed to find flat areas to fill // and overhangs that need to be supported. these are stored in flats // and bridges, projected up/down, and merged into an array of solids - if (solidLayers && !vaseMode && !isSynth) { + if ((topLayers || bottomLayers || solidLayers) && !vaseMode && !isSynth) { profileStart("delta"); forSlices(0.2, 0.34, slice => { let params = slice.params || process; @@ -703,8 +705,8 @@ FDM.slice = function(settings, widget, onupdate, ondone) { profileEnd(); profileStart("delta-project"); forSlices(0.34, 0.35, slice => { - projectFlats(slice, solidLayers); - projectBridges(slice, solidLayers); + if (solidLayers || topLayers) projectFlats(slice, solidLayers || topLayers); + if (solidLayers || bottomLayers) projectBridges(slice, solidLayers || bottomLayers); }, "layer deltas"); profileEnd(); profileStart("solid-fill") diff --git a/src/kiri/conf.js b/src/kiri/conf.js index 1e582296..b5f4a6e7 100644 --- a/src/kiri/conf.js +++ b/src/kiri/conf.js @@ -327,7 +327,6 @@ const conf = exports({ sliceSupportEnable: false, sliceSupportOutline: true, sliceSolidMinArea: 1, - sliceSolidLayers: 3, sliceBottomLayers: 3, sliceTopLayers: 3, firstSliceHeight: 0.25, diff --git a/src/kiri/init.js b/src/kiri/init.js index 4559e38d..b585944e 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1817,7 +1817,6 @@ gapp.register("kiri.init", [], (root, exports) => { sliceLineWidth: uc.newInput(LANG.sl_line_s, {title:LANG.sl_line_l, convert:uc.toFloat, bound:uc.bound(0,5), modes:FDM}), fdmSep: uc.newBlank({class:"pop-sep", modes:FDM}), sliceTopLayers: uc.newInput(LANG.sl_ltop_s, {title:LANG.sl_ltop_l, convert:uc.toInt, modes:FDM}), - sliceSolidLayers: uc.newInput(LANG.sl_lsld_s, {title:LANG.sl_lsld_l, convert:uc.toInt, modes:FDM}), sliceBottomLayers: uc.newInput(LANG.sl_lbot_s, {title:LANG.sl_lbot_l, convert:uc.toInt, modes:FDM}), fdmSep: uc.newBlank({class:"pop-sep", modes:FDM}), sliceDetectThin: uc.newSelect(LANG.ad_thin_s, {title: LANG.ad_thin_l, action: thinWallSave, modes:FDM}, "thin"), diff --git a/web/kiri/engine.html b/web/kiri/engine.html index fd2a51ac..1825bbe5 100644 --- a/web/kiri/engine.html +++ b/web/kiri/engine.html @@ -120,7 +120,6 @@ sliceShells: 1, sliceFillSparse: 0.25, sliceTopLayers: 2, - sliceSolidLayers: 2, sliceBottomLayers: 2 })) .then(eng => eng.setDevice({ diff --git a/web/kiri/lang/en.js b/web/kiri/lang/en.js index 88006056..396cfb27 100644 --- a/web/kiri/lang/en.js +++ b/web/kiri/lang/en.js @@ -315,11 +315,11 @@ self.kiri.lang['en-us'] = { ad_minl_s: "height min", ad_minl_l: ["adaptive min layer height","in millimeters","must be non-zero"], sl_ltop_s: "top layers", - sl_ltop_l: ["number of solid layers","to enforce at the","top of the print"], + sl_ltop_l: ["number of solid layers at the top of the print or on flat areas facing up"], sl_lsld_s: "solid layers", sl_lsld_l: ["solid fill areas computed","from bridges and flat areas","detected betwen sliced layers"], sl_lbot_s: "base layers", - sl_lbot_l: ["number of solid layers","to enforce at the","bottom of the print"], + sl_lbot_l: ["number of solid layers at bottom of the print or under bridge spans"], ad_adap_s: "adaptive", ad_adap_l: ["use adaptive layer heights","with 'layer height' as max","and 'layer min' as the min"],