align FDM top/bottom layer options with convention

This commit is contained in:
Stewart Allen 2022-10-31 19:12:41 -04:00
commit 75fc39b545
7 changed files with 10 additions and 11 deletions

View file

@ -21,7 +21,6 @@
"sliceSupportAngle": 50,
"sliceSupportNozzle": 0,
"sliceSolidMinArea": 1,
"sliceSolidLayers": 3,
"sliceBottomLayers": 3,
"sliceTopLayers": 3,
"firstLayerRate": 10,

View file

@ -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")

View file

@ -327,7 +327,6 @@ const conf = exports({
sliceSupportEnable: false,
sliceSupportOutline: true,
sliceSolidMinArea: 1,
sliceSolidLayers: 3,
sliceBottomLayers: 3,
sliceTopLayers: 3,
firstSliceHeight: 0.25,

View file

@ -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"),