loops are now set in ranges much more intuitively
This commit is contained in:
parent
02851d19a6
commit
a20ba0a163
8 changed files with 59 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "grid-apps",
|
"name": "grid-apps",
|
||||||
"version": "2.9.1D",
|
"version": "2.9.2D",
|
||||||
"description": "grid.space 3d slice & modeling tools",
|
"description": "grid.space 3d slice & modeling tools",
|
||||||
"author": "Stewart Allen <sa@grid.space>",
|
"author": "Stewart Allen <sa@grid.space>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
if (!self.kiri) {
|
if (!self.kiri) {
|
||||||
self.kiri = {
|
self.kiri = {
|
||||||
beta: 2901,
|
beta: 2902,
|
||||||
driver: {}, // driver modules
|
driver: {}, // driver modules
|
||||||
loader: [] // module loading: array of functions
|
loader: [] // module loading: array of functions
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -345,6 +345,7 @@
|
||||||
outputLayerRetract: false,
|
outputLayerRetract: false,
|
||||||
outputOriginCenter: true,
|
outputOriginCenter: true,
|
||||||
outputLoopLayers: "",
|
outputLoopLayers: "",
|
||||||
|
outputLoops: 0,
|
||||||
outputPeelGuard: 0,
|
outputPeelGuard: 0,
|
||||||
outputInvertX: false,
|
outputInvertX: false,
|
||||||
outputInvertY: false,
|
outputInvertY: false,
|
||||||
|
|
|
||||||
|
|
@ -1802,7 +1802,8 @@
|
||||||
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
|
fdmSep: UC.newBlank({class:"pop-sep", modes:FDM}),
|
||||||
outputPeelGuard: UC.newInput(LANG.ag_peel_s, {title:LANG.ag_peel_l, convert:UC.toInt, modes:FDM, comma:true, show:isBelt}),
|
outputPeelGuard: UC.newInput(LANG.ag_peel_s, {title:LANG.ag_peel_l, convert:UC.toInt, modes:FDM, comma:true, show:isBelt}),
|
||||||
gcodePauseLayers: UC.newInput(LANG.ag_paws_s, {title:LANG.ag_paws_l, modes:FDM, comma:true, show:isNotBelt}),
|
gcodePauseLayers: UC.newInput(LANG.ag_paws_s, {title:LANG.ag_paws_l, modes:FDM, comma:true, show:isNotBelt}),
|
||||||
outputLoopLayers: UC.newInput(LANG.ag_loop_s, {title:LANG.ag_loop_l, modes:FDM, comma:true, show:isBelt}),
|
// outputLoopLayers: UC.newInput(LANG.ag_loop_s, {title:LANG.ag_loop_l, modes:FDM, comma:true, show:isBelt}),
|
||||||
|
outputLoops: UC.newInput(LANG.ag_loop_s, {title:LANG.ag_loop_l, convert:UC.toInt, bound:UC.bound(0,1000), modes:FDM, show:isBelt}),
|
||||||
outputLayerRetract: UC.newBoolean(LANG.ad_lret_s, onBooleanClick, {title:LANG.ad_lret_l, modes:FDM}),
|
outputLayerRetract: UC.newBoolean(LANG.ad_lret_s, onBooleanClick, {title:LANG.ad_lret_l, modes:FDM}),
|
||||||
outputPurgeTower: UC.newBoolean(LANG.ad_purg_s, onBooleanClick, {title:LANG.ad_purg_l, modes:FDM, show:isMultiHead}),
|
outputPurgeTower: UC.newBoolean(LANG.ad_purg_s, onBooleanClick, {title:LANG.ad_purg_l, modes:FDM, show:isMultiHead}),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
let terms = {
|
let terms = {
|
||||||
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||||
LICENSE: "See the license.md file included with the source distribution",
|
LICENSE: "See the license.md file included with the source distribution",
|
||||||
VERSION: "2.9.D1"
|
VERSION: "2.9.D2"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof(module) === 'object') {
|
if (typeof(module) === 'object') {
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
"outputShortPoly": LANG.ad_spol_s,
|
"outputShortPoly": LANG.ad_spol_s,
|
||||||
"outputMinSpeed": LANG.ad_mins_s,
|
"outputMinSpeed": LANG.ad_mins_s,
|
||||||
"outputCoastDist": LANG.ad_scst_s,
|
"outputCoastDist": LANG.ad_scst_s,
|
||||||
|
"outputLoops": LANG.ag_loop_s,
|
||||||
"sliceSupportDensity": LANG.sp_dens_s,
|
"sliceSupportDensity": LANG.sp_dens_s,
|
||||||
"sliceSupportOffset": LANG.sp_offs_s,
|
"sliceSupportOffset": LANG.sp_offs_s,
|
||||||
"sliceLayerStart": LANG.sl_strt_s,
|
"sliceLayerStart": LANG.sl_strt_s,
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
extrudeSet = false,
|
extrudeSet = false,
|
||||||
time = 0,
|
time = 0,
|
||||||
layer = 0,
|
layer = 0,
|
||||||
|
layerno = 0,
|
||||||
pause = [],
|
pause = [],
|
||||||
pauseCmd = device.gcodePause,
|
pauseCmd = device.gcodePause,
|
||||||
output = [],
|
output = [],
|
||||||
|
|
@ -51,7 +52,8 @@
|
||||||
blast = 0,
|
blast = 0,
|
||||||
blastz = 0,
|
blastz = 0,
|
||||||
process = settings.process,
|
process = settings.process,
|
||||||
loops = process.outputLoopLayers,
|
// loops = process.outputLoopLayers,
|
||||||
|
loops = process.outputLoops || 0,
|
||||||
zhop = process.zHopDistance || 0, // range
|
zhop = process.zHopDistance || 0, // range
|
||||||
seekMMM = process.outputSeekrate * 60,
|
seekMMM = process.outputSeekrate * 60,
|
||||||
retDist = process.outputRetractDist || 0, // range
|
retDist = process.outputRetractDist || 0, // range
|
||||||
|
|
@ -128,20 +130,41 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isBelt && loops) {
|
// collect loops from ranges and synth range array
|
||||||
loops = loops.split(',').map(range => {
|
let rloops = [];
|
||||||
return range.split('-').map(v => parseInt(v));
|
if (loops > 0) {
|
||||||
}).filter(a => a.length > 1).map(a => {
|
rloops.push({
|
||||||
return {
|
start: layers[0].slice.index,
|
||||||
start: a[0],
|
end: layers.last().slice.index,
|
||||||
end: a[1] ? a[1] + 1 : Infinity,
|
iter: loops - 1
|
||||||
iter: a[2] >= 0 ? a[2] : 1
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!isBelt || (loops && loops.length < 1)) {
|
for (let range of process.ranges) {
|
||||||
loops = undefined;
|
console.log({range});
|
||||||
|
if (range.fields.outputLoops) {
|
||||||
|
rloops.push({
|
||||||
|
start: range.lo,
|
||||||
|
end: range.hi,
|
||||||
|
iter: range.fields.outputLoops - 1
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
loops = isBelt && rloops.length ? rloops : undefined;
|
||||||
|
|
||||||
|
// if (isBelt && loops) {
|
||||||
|
// loops = loops.split(',').map(range => {
|
||||||
|
// return range.split('-').map(v => parseInt(v));
|
||||||
|
// }).filter(a => a.length > 1).map(a => {
|
||||||
|
// return {
|
||||||
|
// start: a[0],
|
||||||
|
// end: a[1] ? a[1] + 1 : Infinity,
|
||||||
|
// iter: a[2] >= 0 ? a[2] : 1
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// if (!isBelt || (loops && loops.length < 1)) {
|
||||||
|
// loops = undefined;
|
||||||
|
// }
|
||||||
|
|
||||||
(process.gcodePauseLayers || "").split(",").forEach(function(lv) {
|
(process.gcodePauseLayers || "").split(",").forEach(function(lv) {
|
||||||
let v = parseInt(lv);
|
let v = parseInt(lv);
|
||||||
|
|
@ -333,6 +356,7 @@
|
||||||
|
|
||||||
while (layer < layers.length) {
|
while (layer < layers.length) {
|
||||||
path = layers[layer];
|
path = layers[layer];
|
||||||
|
layerno = path.slice.index;
|
||||||
|
|
||||||
// range overrides
|
// range overrides
|
||||||
if (path.layer >= 0) {
|
if (path.layer >= 0) {
|
||||||
|
|
@ -366,15 +390,17 @@
|
||||||
appendAllSub(pauseCmd)
|
appendAllSub(pauseCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let endloop = false;
|
||||||
if (loops) {
|
if (loops) {
|
||||||
if (inLoop) {
|
if (inLoop) {
|
||||||
if (layer === inLoop.end) {
|
if (layerno === inLoop.end) {
|
||||||
append(`M808`);
|
endloop = true;
|
||||||
inLoop = undefined;
|
// append(`M808`);
|
||||||
|
// inLoop = undefined;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (let loop of loops) {
|
for (let loop of loops) {
|
||||||
if (layer === loop.start) {
|
if (layerno === loop.start) {
|
||||||
append(`M808 L${loop.iter}`);
|
append(`M808 L${loop.iter}`);
|
||||||
if (extrudeAbs) {
|
if (extrudeAbs) {
|
||||||
append(`G92 Z${lout.z.round(decimals)} E${outputLength.round(decimals)}`);
|
append(`G92 Z${lout.z.round(decimals)} E${outputLength.round(decimals)}`);
|
||||||
|
|
@ -556,6 +582,12 @@
|
||||||
laste = out.emit;
|
laste = out.emit;
|
||||||
}
|
}
|
||||||
layer++;
|
layer++;
|
||||||
|
|
||||||
|
// end open loop when detected
|
||||||
|
if (endloop) {
|
||||||
|
append(`M808`);
|
||||||
|
inLoop = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
drainQ();
|
drainQ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -597,8 +597,10 @@ kiri.lang['en-us'] = {
|
||||||
ag_peel_l: ["starting at this belt z positoin","periodically roll the print off and","back on to the belt to unstick it","and prevent rolling deflection"],
|
ag_peel_l: ["starting at this belt z positoin","periodically roll the print off and","back on to the belt to unstick it","and prevent rolling deflection"],
|
||||||
ag_paws_s: "pause layers",
|
ag_paws_s: "pause layers",
|
||||||
ag_paws_l: ["comma-separated list of layers","to inject pause commands before"],
|
ag_paws_l: ["comma-separated list of layers","to inject pause commands before"],
|
||||||
ag_loop_s: "loop layers",
|
// ag_loop_s: "loop layers",
|
||||||
ag_loop_l: ["layer ranges to repeat in the format","first-last-count,first-last-count,...","omitted count = 1"],
|
// ag_loop_l: ["layer ranges to repeat in the format","first-last-count,first-last-count,...","omitted count = 1"],
|
||||||
|
ag_loop_s: "loop count",
|
||||||
|
ag_loop_l: ["number of times to repeat","the selected range or the","entire print if no range"],
|
||||||
|
|
||||||
// SLA MENU
|
// SLA MENU
|
||||||
sa_menu: "slicing",
|
sa_menu: "slicing",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue