add generic pre-pad offsetting. keep snap/png in clear for belt

This commit is contained in:
Stewart Allen 2021-11-17 15:03:28 -05:00
commit c460c6924b
4 changed files with 11 additions and 4 deletions

View file

@ -475,14 +475,15 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
p.length = p.length.round(2);
p.extrusion = p.extrusion.round(2);
});
// add length push filament to the last segment
// add length of push filament to the last segment
segments.peek().emitted += pinfo.push;
let lastEmit = 0;
for (let seg of segments) {
let seginfo = driveInfo[seg.tool] = driveInfo[seg.tool] || { length: 0, volume: 0 };
seg.emitted += pinfo.offset;
seginfo.length += seg.emitted - lastEmit;
seginfo.volume = seginfo.length * Math.PI;
volume[seg.tool+1] = (seginfo.volume + 2).round(2); // prepad 2mm
volume[seg.tool+1] = seginfo.volume.round(2);
length[seg.tool+1] = seginfo.length.round(2);
lastEmit = seg.emitted;
}
@ -562,7 +563,7 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
KIRI.work.png({}, data => {
png = data.png;
});
console.log({meta,palette});
// console.log({meta,palette});
downloadPalette.onclick = function() {
KIRI.client.zip([
{name:"meta.json", data:JSON.stringify(meta,undefined,4)},

View file

@ -1670,6 +1670,8 @@
palettePing: UC.newInput(LANG.dv_paps_s, {title:LANG.dv_paps_l, modes:FDM, convert:UC.toInt}),
paletteFeed: UC.newInput(LANG.dv_pafe_s, {title:LANG.dv_pafe_l, modes:FDM, convert:UC.toInt}),
palettePush: UC.newInput(LANG.dv_papl_s, {title:LANG.dv_papl_l, modes:FDM, convert:UC.toInt}),
paletteOffset: UC.newInput(LANG.dv_paof_s, {title:LANG.dv_paof_l, modes:FDM, convert:UC.toInt}),
paletteSep: UC.newBlank({class:"pop-sep", modes:FDM}),
paletteHeat: UC.newInput(LANG.dv_pahe_s, {title:LANG.dv_pahe_l, modes:FDM, convert:UC.toInt}),
paletteCool: UC.newInput(LANG.dv_paco_s, {title:LANG.dv_paco_l, modes:FDM, convert:UC.toInt}),
palettePress: UC.newInput(LANG.dv_pacm_s, {title:LANG.dv_pacm_l, modes:FDM, convert:UC.toInt}),
@ -2814,6 +2816,7 @@
UI.palettePing.value = pinfo.ping || 0;
UI.paletteFeed.value = pinfo.feed || 0;
UI.palettePush.value = pinfo.push || 0;
UI.paletteOffset.value = pinfo.offset || 0;
UI.paletteHeat.value = pinfo.heat || 0;
UI.paletteCool.value = pinfo.cool || 0;
UI.palettePress.value = pinfo.press || 0;
@ -2831,6 +2834,7 @@
ping: UI.palettePing.convert(),
feed: UI.paletteFeed.convert(),
push: UI.palettePush.convert(),
offset: UI.paletteOffset.convert(),
heat: UI.paletteHeat.convert(),
cool: UI.paletteCool.convert(),
press: UI.palettePress.convert()

View file

@ -233,7 +233,7 @@ KIRI.worker = {
},
clear: function(data, send) {
current.snap = null;
// current.snap = null;
current.print = null;
dispatch.group = wgroup = {};
dispatch.cache = wcache = {};

View file

@ -174,6 +174,8 @@ kiri.lang['en-us'] = {
dv_pafe_l: ["feeder tube length in millimeters","short=570, medium=800, long=1100"],
dv_papl_s: "push length",
dv_papl_l: ["distance between extruder gear","and nozzle tip in millimeters"],
dv_paof_s: "offset length",
dv_paof_l: ["length to add or remove from","the first segment in millimeters","usually 0"],
dv_pahe_s: "heating time",
dv_pahe_l: ["offset from default"],
dv_paco_s: "cooling time",