fix slice first height, settings loading

This commit is contained in:
Stewart Allen 2020-06-09 23:19:51 -04:00
commit 993170a75b
6 changed files with 31 additions and 6 deletions

View file

@ -16,7 +16,8 @@
# FDM
* `B` fix nozzle offset for new rendering modes
* `B` fix adaptive slicing with multi-extruder
* `B` fix supports with grouped parts
* `F` control for size of purge block (with 0=disabled)
* `F` add separate fill speed control
* `F` manual support addition / control

View file

@ -321,6 +321,9 @@
case cca('q'): // preferences
API.modal.show('prefs');
break;
case cca('l'): // device
settingsLoad();
break;
case cca('e'): // device
showDevices();
break;

View file

@ -1719,7 +1719,6 @@
let mode = getMode(),
name = e ? e.target.getAttribute("load") : named || settings.cproc[mode],
load = settings.sproc[mode][name];
if (!load) return;
settings.process = clone(load);
@ -1753,7 +1752,6 @@
for (let k in sp) {
if (sp.hasOwnProperty(k)) list.push(k);
}
console.log({list});
list.sort().forEach(function(sk) {
let row = DOC.createElement('div'),
load = DOC.createElement('button'),
@ -1762,7 +1760,10 @@
name = sk;
load.setAttribute('load', sk);
load.onclick = API.conf.load;
load.onclick = (ev) => {
API.conf.load(undefined, sk);
updateSettingsList();
}
load.appendChild(DOC.createTextNode(sk));
if (sk == settings.process.processName) {
load.setAttribute('class', 'selected')

View file

@ -100,7 +100,7 @@
bounds = btmp;
}
let zMin = options.zmin || Math.floor(bounds.min.z),
let zMin = options.zmin || options.firstHeight || Math.floor(bounds.min.z),
zMax = options.zmax || Math.ceil(bounds.max.z),
zInc = options.height,
zIncMin = options.minHeight,
@ -268,6 +268,7 @@
// copy to store original z
zHeights = zIndexes.slice();
} else if (zIncMin) {
// console.log('adaptive slicing', zIncMin, ':', zInc, 'from', zMin, 'to', zMax);
// FDM adaptive slicing
let zPos = zMin + zIncFirst,
zOI = 0,
@ -308,6 +309,7 @@
}
}
} else {
// console.log('fixed slicing', zInc, 'from', zMin, 'to', zMax);
// FDM fixed slicing
if (options.firstHeight) {
zIndexes.push(options.firstHeight / 2);
@ -319,6 +321,7 @@
zHeights.push(zInc);
}
}
// create a Slice for each z offset in the zIndexes array
for (let i = 0; i < zIndexes.length; i++) {
let ik = zIndexes[i].toFixed(5),

View file

@ -106,7 +106,17 @@
}
function onSliceDone(slices) {
slices = slices.filter(slice => slice.tops.length);
// slices = slices.filter(slice => slice.tops.length);
// remove all empty slices above part but leave below
// for multi-part (multi-extruder) setups where the void is ok
let found = false;
slices = slices.reverse().filter(slice => {
if (slice.tops.length) {
return found = true;
} else {
return found;
}
}).reverse();
widget.slices = slices;

View file

@ -578,6 +578,13 @@ th, tr, td {
border-bottom-right-radius: 10px;
background-color: var(--bg-gray);
}
#settingsList button.selected {
font-weight: bold;
background-color: #ccc;
}
#settingsList button.selected:hover {
background-color: #aaa;
}
#help p {
margin: 2px;