more intelligent sync. but clear/sync in belt mode. eliminate layer support gap in belt mode

This commit is contained in:
Stewart Allen 2021-02-08 10:55:36 -05:00
commit f35ab73858
6 changed files with 20 additions and 4 deletions

View file

@ -2,7 +2,6 @@
## `C` cosmetic, `F` functional, `P` performance, `B` bug fix
* `B` client/worker cache invalidated by latest rotation work. revisit sync.
* `B` normals possibly inverted on faces in 2D to 3D conversion
* `B` origin bug (Onshape?) when switching modes in 2.5 and 2.6

View file

@ -121,6 +121,9 @@ KIRI.work = {
// widget sync
sync: function() {
// send list of currently valid widgets
send("sync", { valid: KIRI.api.widgets.all().map(w => w.id) }, () => {});
// sync any widget that has changed
let widgets = KIRI.api.widgets.all();
widgets.forEach(widget => {
if (widget.modified || !syncd[widget.id]) {

View file

@ -1685,7 +1685,7 @@
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
sliceSupportSize: UC.newInput(LANG.sp_size_s, {title:LANG.sp_size_l, bound:UC.bound(1.0,200.0), convert:UC.toFloat, modes:FDM}),
sliceSupportOffset: UC.newInput(LANG.sp_offs_s, {title:LANG.sp_offs_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
sliceSupportGap: UC.newInput(LANG.sp_gaps_s, {title:LANG.sp_gaps_l, bound:UC.bound(0,5), convert:UC.toInt, modes:FDM}),
sliceSupportGap: UC.newInput(LANG.sp_gaps_s, {title:LANG.sp_gaps_l, bound:UC.bound(0,5), convert:UC.toInt, modes:FDM, show:isNotBelt}),
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
sliceSupportArea: UC.newInput(LANG.sp_area_s, {title:LANG.sp_area_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),
sliceSupportExtra: UC.newInput(LANG.sp_xpnd_s, {title:LANG.sp_xpnd_l, bound:UC.bound(0.0,200.0), convert:UC.toFloat, modes:FDM}),

View file

@ -871,7 +871,7 @@
setOpacity(color.slicing_opacity);
STACKS.clear();
if (mode === 'FDM') {
if (settings.device.bedBelt) {
KIRI.client.clear();
}
KIRI.client.sync();

View file

@ -51,6 +51,20 @@ KIRI.worker = {
// widget sync
sync: function(data, send) {
if (data.valid) {
// remove widgets not present in valid list
for (let key in wcache) {
if (data.valid.indexOf(key) < 0) {
delete wcache[key];
for (let [id,group] of Object.entries(wgroup)) {
wgroup[id] = group = group.filter(v => v.id !== key);
group.id = id;
}
}
}
return;
}
let group = wgroup[data.group];
if (!group) {
group = [];

View file

@ -191,7 +191,7 @@
slice.addTop(u);
}
}
let gap = sliceHeight * spro.sliceSupportGap
let gap = sliceHeight * (isBelt ? 0 : spro.sliceSupportGap);
// clip tops to other widgets in group
tops = slice.topPolys();
for (let peer of widget.group) {