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 # 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` control for size of purge block (with 0=disabled)
* `F` add separate fill speed control * `F` add separate fill speed control
* `F` manual support addition / control * `F` manual support addition / control

View file

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

View file

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

View file

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

View file

@ -106,7 +106,17 @@
} }
function onSliceDone(slices) { 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; widget.slices = slices;

View file

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