modify retraction. use outer offsets for bisection
This commit is contained in:
parent
32740aed9b
commit
e800e65d30
2 changed files with 18 additions and 6 deletions
|
|
@ -289,6 +289,7 @@ var gs_kiri_fdm = exports;
|
||||||
bottom: offset ? 0 : -device.bedDepth/2,
|
bottom: offset ? 0 : -device.bedDepth/2,
|
||||||
z_max: device.maxHeight
|
z_max: device.maxHeight
|
||||||
},
|
},
|
||||||
|
fillBridgeDist = device.nozzleSize * 2,
|
||||||
shortDist = process.outputShortDistance,
|
shortDist = process.outputShortDistance,
|
||||||
shortFact = process.outputShortFactor,
|
shortFact = process.outputShortFactor,
|
||||||
maxPrintMMM = process.outputFeedrate * 60,
|
maxPrintMMM = process.outputFeedrate * 60,
|
||||||
|
|
@ -346,6 +347,10 @@ var gs_kiri_fdm = exports;
|
||||||
append(constReplace(line, consts));
|
append(constReplace(line, consts));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dwell(ms) {
|
||||||
|
append("G4 P" + ms);
|
||||||
|
}
|
||||||
|
|
||||||
function moveTo(newpos, rate, comment) {
|
function moveTo(newpos, rate, comment) {
|
||||||
var o = ['G1'];
|
var o = ['G1'];
|
||||||
if (typeof newpos.x === 'number') {
|
if (typeof newpos.x === 'number') {
|
||||||
|
|
@ -405,7 +410,7 @@ var gs_kiri_fdm = exports;
|
||||||
out = path[pidx];
|
out = path[pidx];
|
||||||
// if no point in output, it's a dwell command
|
// if no point in output, it's a dwell command
|
||||||
if (!out.point) {
|
if (!out.point) {
|
||||||
append("G4 P" + out.speed);
|
dwell(out.speed);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var x = out.point.x,
|
var x = out.point.x,
|
||||||
|
|
@ -438,10 +443,17 @@ var gs_kiri_fdm = exports;
|
||||||
moveTo({x:x, y:y, e:emitMM}, outMMM);
|
moveTo({x:x, y:y, e:emitMM}, outMMM);
|
||||||
emitted += emitMM;
|
emitted += emitMM;
|
||||||
} else {
|
} else {
|
||||||
var retract = laste && retOver > 0.0 && dist > retOver;
|
if (laste && retOver > 0.0 && dist > retOver) {
|
||||||
if (retract) moveTo({e:-retDist}, retSpeed, "ooze retract");
|
//
|
||||||
moveTo({x:x, y:y}, seekMMM);
|
moveTo({e:-retDist}, retSpeed, "ooze retract");
|
||||||
if (retract) moveTo({e:retDist}, retSpeed, "re-engage");
|
moveTo({x:x, y:y}, seekMMM);
|
||||||
|
moveTo({e:retDist}, retSpeed, "re-engage");
|
||||||
|
} else if (lastp && dist <= fillBridgeDist) {
|
||||||
|
var e = (layer === 0 ? emitPerMMLayer1 : emitPerMM) * dist;
|
||||||
|
moveTo({x:x, y:y, e:e}, outMMM);
|
||||||
|
} else {
|
||||||
|
moveTo({x:x, y:y}, seekMMM);
|
||||||
|
}
|
||||||
time += (dist / seekMMM) * 60; // seek distance
|
time += (dist / seekMMM) * 60; // seek distance
|
||||||
time += (retDist / retSpeed) * 60 * 2; // retraction time
|
time += (retDist / retSpeed) * 60 * 2; // retraction time
|
||||||
// approximate compensation for acceleration & deceleration
|
// approximate compensation for acceleration & deceleration
|
||||||
|
|
|
||||||
|
|
@ -497,7 +497,7 @@ var gs_kiri_print = exports;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// top object
|
// top object
|
||||||
var bounds = POLY.flatten(next.inner);
|
var bounds = POLY.flatten(next.outer);
|
||||||
outputTraces([].appendAll(next.traces).appendAll(next.innerTraces() || []), bounds);
|
outputTraces([].appendAll(next.traces).appendAll(next.innerTraces() || []), bounds);
|
||||||
outputFills(next.fill_lines, bounds);
|
outputFills(next.fill_lines, bounds);
|
||||||
outputSparse(next.fill_sparse, bounds);
|
outputSparse(next.fill_sparse, bounds);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue