checkpoint range work

This commit is contained in:
Stewart Allen 2021-02-11 17:34:42 -05:00
commit b71ff1fa0b
4 changed files with 29 additions and 22 deletions

View file

@ -40,6 +40,7 @@
* `F` apply finish speed to exposed top and underside flat areas * `F` apply finish speed to exposed top and underside flat areas
* `F` expand internal supporting flats / solids before projection * `F` expand internal supporting flats / solids before projection
* `P` extruder + filament max flow rate cap in planner
* `P` revisit path routing / optimization * `P` revisit path routing / optimization
* `P` implement infill clipping in wasm * `P` implement infill clipping in wasm
* `P` solid fill the tops of supports for down facing flats * `P` solid fill the tops of supports for down facing flats

View file

@ -504,7 +504,6 @@
extruder = slice.extruder || 0, extruder = slice.extruder || 0,
nozzleSize = device.extruders[extruder].extNozzle, nozzleSize = device.extruders[extruder].extNozzle,
firstLayer = opt.first || false, firstLayer = opt.first || false,
minSeek = nozzleSize * (opt.minSeek || 1.5),
thinWall = nozzleSize * (opt.thinWall || 1.75), thinWall = nozzleSize * (opt.thinWall || 1.75),
retractDist = opt.retractOver || 2, retractDist = opt.retractOver || 2,
fillMult = opt.mult || process.outputFillMult, fillMult = opt.mult || process.outputFillMult,
@ -524,7 +523,6 @@
zhop = process.zHopDistance || 0, zhop = process.zHopDistance || 0,
antiBacklash = process.antiBacklash, antiBacklash = process.antiBacklash,
wipeDist = process.outputRetractWipe || 0, wipeDist = process.outputRetractWipe || 0,
doSupport = opt.support,
isBelt = device.bedBelt, isBelt = device.bedBelt,
startClone = startPoint.clone(), startClone = startPoint.clone(),
z = slice.z, z = slice.z,

View file

@ -27,29 +27,32 @@
PROC = Object.keys(kiri.conf.defaults.fdm.p); PROC = Object.keys(kiri.conf.defaults.fdm.p);
let rangeVars = { let rangeVars = {
// slice
"sliceShells": LANG.sl_shel_s, "sliceShells": LANG.sl_shel_s,
"sliceFillType": LANG.fi_type, "sliceFillType": LANG.fi_type,
"sliceFillSparse": LANG.fi_pcnt_s, "sliceFillSparse": LANG.fi_pcnt_s,
"sliceSolidMinArea": LANG.ad_msol_s,
// prepare
"sliceShellOrder": LANG.sl_ordr_s, "sliceShellOrder": LANG.sl_ordr_s,
"outputTemp": LANG.ou_nozl_s,
"outputBedTemp": LANG.ou_bedd_s,
"outputFeedrate": LANG.ou_feed_s, "outputFeedrate": LANG.ou_feed_s,
"outputFinishrate": LANG.ou_fini_s, "outputFinishrate": LANG.ou_fini_s,
"outputShellMult": LANG.ou_shml_s, "outputShellMult": LANG.ou_shml_s,
"outputFillMult": LANG.ou_flml_s, "outputFillMult": LANG.ou_flml_s,
"outputSparseMult": LANG.ou_spml_s, "outputSparseMult": LANG.ou_spml_s,
"outputRetractDist": LANG.ad_rdst_s,
"outputRetractSpeed": LANG.outputRetractSpeed,
"outputRetractWipe": LANG.ad_wpln_s, "outputRetractWipe": LANG.ad_wpln_s,
"outputRetractDwell": LANG.ad_rdwl_s,
"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,
"sliceSupportDensity": LANG.sp_dens_s, "sliceSupportDensity": LANG.sp_dens_s,
"sliceSupportOffset": LANG.sp_offs_s, "sliceSupportOffset": LANG.sp_offs_s,
"sliceSolidMinArea": LANG.ad_msol_s,
"sliceLayerStart": LANG.sl_strt_s, "sliceLayerStart": LANG.sl_strt_s,
"zHopDistance": LANG.ad_zhop_s "zHopDistance": LANG.ad_zhop_s,
// export
"outputTemp": LANG.ou_nozl_s,
"outputBedTemp": LANG.ou_bedd_s,
"outputRetractDist": LANG.ad_rdst_s,
"outputRetractSpeed": LANG.outputRetractSpeed,
"outputRetractDwell": LANG.ad_rdwl_s,
}; };
for (let key of Object.keys(rangeVars)) { for (let key of Object.keys(rangeVars)) {

View file

@ -15,9 +15,9 @@
FDM.export = function(print, online) { FDM.export = function(print, online) {
let layers = print.output, let layers = print.output,
settings = FDM.fixExtruders(print.settings), settings = FDM.fixExtruders(print.settings),
getRangeParameters = FDM.getRangeParameters,
device = settings.device, device = settings.device,
extruders = device.extruders, extruders = device.extruders,
process = settings.process,
gcodeFan = device.gcodeFan, gcodeFan = device.gcodeFan,
gcodeLayer = device.gcodeLayer, gcodeLayer = device.gcodeLayer,
gcodeTrack = device.gcodeTrack, gcodeTrack = device.gcodeTrack,
@ -46,11 +46,13 @@
lout = null, lout = null,
last = null, last = null,
zpos = 0, zpos = 0,
zhop = process.zHopDistance || 0, process = settings.process,
loops = process.outputLoopLayers,
zhop = process.zHopDistance || 0, // range
seekMMM = process.outputSeekrate * 60, seekMMM = process.outputSeekrate * 60,
retDist = process.outputRetractDist, retDist = process.outputRetractDist, // range
retSpeed = process.outputRetractSpeed * 60, retSpeed = process.outputRetractSpeed * 60, // range
retDwell = process.outputRetractDwell || 0, retDwell = process.outputRetractDwell || 0, // range
timeDwell = retDwell / 1000, timeDwell = retDwell / 1000,
arcDist = isBelt || !isDanger ? 0 : (process.arcTolerance || 0), arcDist = isBelt || !isDanger ? 0 : (process.arcTolerance || 0),
originCenter = process.outputOriginCenter, originCenter = process.outputOriginCenter,
@ -62,9 +64,9 @@
travel_speed: seekMMM, travel_speed: seekMMM,
retract_speed: retSpeed, retract_speed: retSpeed,
retract_distance: retDist, retract_distance: retDist,
temp: process.firstLayerNozzleTemp || process.outputTemp, temp: process.firstLayerNozzleTemp || process.outputTemp, // range
temp_bed: process.firstLayerBedTemp || process.outputBedTemp, temp_bed: process.firstLayerBedTemp || process.outputBedTemp, // range
bed_temp: process.firstLayerBedTemp || process.outputBedTemp, bed_temp: process.firstLayerBedTemp || process.outputBedTemp, // range
fan_speed: process.outputFanMax, fan_speed: process.outputFanMax,
speed: process.outputFanMax, // legacy speed: process.outputFanMax, // legacy
top: offset ? device.bedDepth : device.bedDepth/2, top: offset ? device.bedDepth : device.bedDepth/2,
@ -82,9 +84,8 @@
bytes = 0, bytes = 0,
bcos = Math.cos(Math.PI/4), bcos = Math.cos(Math.PI/4),
icos = 1 / bcos, icos = 1 / bcos,
loops = process.outputLoopLayers,
inLoop, inLoop,
arcAt, params,
arcQ = []; arcQ = [];
if (isBelt && loops) { if (isBelt && loops) {
@ -283,6 +284,10 @@
while (layer < layers.length) { while (layer < layers.length) {
path = layers[layer]; path = layers[layer];
params = getRangeParameters(settings, path.layer);
// TODO update process settings from params override
// console.log(path.layer, params)
emitPerMM = print.extrudePerMM( emitPerMM = print.extrudePerMM(
extruder.extNozzle, extruder.extNozzle,
extruder.extFilament, extruder.extFilament,
@ -340,13 +345,13 @@
if (layer === 1) { if (layer === 1) {
// update temps when first layer overrides are present // update temps when first layer overrides are present
if (process.firstLayerNozzleTemp) { if (process.firstLayerNozzleTemp) {
subst.temp = process.outputTemp; subst.temp = process.outputTemp; // range
if (t0) appendSub("M104 S{temp} T0"); if (t0) appendSub("M104 S{temp} T0");
if (t1) appendSub("M104 S{temp} T1"); if (t1) appendSub("M104 S{temp} T1");
if (!(t0 || t1)) appendSub("M104 S{temp} T{tool}"); if (!(t0 || t1)) appendSub("M104 S{temp} T{tool}");
} }
if (process.firstLayerBedTemp) { if (process.firstLayerBedTemp) {
subst.bed_temp = subst.temp_bed = process.outputBedTemp; subst.bed_temp = subst.temp_bed = process.outputBedTemp; // range
appendSub("M140 S{temp_bed} T0"); appendSub("M140 S{temp_bed} T0");
} }
} }
@ -359,7 +364,7 @@
// iterate through layer outputs // iterate through layer outputs
for (pidx=0; pidx<path.length; pidx++) { for (pidx=0; pidx<path.length; pidx++) {
out = path[pidx]; out = path[pidx];
speedMMM = (out.speed || process.outputFeedrate) * 60; speedMMM = (out.speed || process.outputFeedrate) * 60; // range
// look for extruder change, run scripts, recalc emit factor // look for extruder change, run scripts, recalc emit factor
if (out.tool !== undefined && out.tool !== tool) { if (out.tool !== undefined && out.tool !== tool) {