add z-hop support on retraction moves

This commit is contained in:
Stewart Allen 2018-02-28 10:10:57 -05:00
commit 522cefabb4
4 changed files with 13 additions and 8 deletions

View file

@ -394,6 +394,7 @@ var gs_kiri_fdm = exports;
pos = {x:0, y:0, z:0, f:0},
last = null,
zpos = 0,
zhop = process.zHopDistance || 0,
offset = process.outputOriginCenter ? null : {
x: device.bedWidth/2,
y: device.bedDepth/2
@ -480,6 +481,7 @@ var gs_kiri_fdm = exports;
function retract() {
retracted = retDist;
moveTo({e:-retracted}, retSpeed, "retract " + retDist);
if (zhop) moveTo({z:zpos + zhop}, seekMMM, "zhop up");
time += (retDist / retSpeed) * 60 * 2; // retraction time
}
@ -591,12 +593,14 @@ var gs_kiri_fdm = exports;
// re-engage post-retraction before new extrusion
if (out.emit && retracted) {
// when enabled, resume previous Z
if (zhop) moveTo({z:zpos}, seekMMM, "zhop down");
// re-engage retracted filament
moveTo({e:retracted}, retSpeed, "engage " + retracted);
retracted = 0;
// optional dwell after re-engaging filament to allow pressure to build
if (retDwell) dwell(retDwell);
time += (retDist / retSpeed) * 60 * 2; // retraction time
if (retDwell) {
dwell(retDwell);
}
}
if (lastp && out.emit) {

View file

@ -496,6 +496,7 @@ var gs_kiri_print = exports;
fillSpeed = opt.speed || opt.fillSpeed || (firstLayer ? firstFillSpeed || firstShellSpeed : process.outputFeedrate),
moveSpeed = process.outputSeekrate,
origin = startPoint.add(offset),
zhop = process.zHopDistance || 0,
antiBacklash = process.antiBacklash,
z = slice.z;
@ -639,7 +640,7 @@ var gs_kiri_print = exports;
addOutput(preout, p2, fillMult * (dist / thinWall), fillSpeed);
} else {
// retract if dist trigger or crosses a slice top polygon
if (dist > retractDist && intersectsTop(startPoint, p1)) {
if (dist > retractDist && (zhop || intersectsTop(startPoint, p1))) {
retract();
}

View file

@ -88,7 +88,6 @@ self.kiri.license = exports.LICENSE;
outputShellMult: 1,
outputFillMult: 1,
outputSparseMult: 1,
outputRetractOver: 1,
outputRetractDist: 1,
outputRetractSpeed: 1,
outputRetractDwell: 1,
@ -101,6 +100,7 @@ self.kiri.license = exports.LICENSE;
outputCooling: 1,
// detectThinWalls: 1,
antiBacklash: 1,
zHopDistance: 1,
gcodeKFactor: 1,
gcodePauseLayers: 1,
outputClockwise: 1,
@ -299,7 +299,6 @@ self.kiri.license = exports.LICENSE;
outputShellMult: 1.1,
outputFillMult: 1.2,
outputSparseMult: 1.3,
outputRetractOver: 5.0,
outputRetractDist: 1.0,
outputRetractSpeed: 40,
outputRetractDwell: 30,
@ -311,6 +310,7 @@ self.kiri.license = exports.LICENSE;
outputFinishFactor: 0,
detectThinWalls: false,
antiBacklash: 2,
zHopDistance: 0,
gcodeKFactor: 0,
gcodePauseLayers: "",
outputCooling: true,
@ -2497,7 +2497,6 @@ self.kiri.license = exports.LICENSE;
outputRaft: UC.newBoolean("enable", onBooleanClick, {title:"create a raft under the\nmodel for better adhesion\nuses skirt offset and\ndisables skirt output", modes:FDM}),
advanced: UC.newGroup("advanced", null, {modes:FDM}),
// outputRetractOver: UC.newInput("retract over", {title:"move threshold that\ntriggers retraction\n0 to disable", convert:UC.toFloat, modes:FDM}),
outputRetractDist: UC.newInput("retract dist", {title:"amount to retract filament", convert:UC.toFloat, modes:FDM}),
outputRetractSpeed: UC.newInput("retract rate", {title:"speed of filament\nretraction in mm/s", convert:UC.toInt, modes:FDM}),
outputRetractDwell: UC.newInput("engage dwell", {title:"time between re-engaging\nfilament and movement\nin milliseconds", convert:UC.toInt, modes:FDM}),
@ -2506,6 +2505,7 @@ self.kiri.license = exports.LICENSE;
outputShortFactor: UC.newInput("short factor", {title:"max speed reduction factor\nfor short segments\nas % of print speed", bound:UC.bound(0.05,1), convert:UC.toFloat, modes:FDM}),
outputFinishFactor: UC.newInput("finish factor", {title:"% of nozzle diameter to\nshorten finish path by\nvalues of 0-1", bound:UC.bound(0.0,1), convert:UC.toFloat, modes:FDM}),
antiBacklash: UC.newInput("anti-backlash", {title: "use micro-movements to cancel\nbacklash during fills\nin millimeters", bound:UC.bound(0,3), convert:UC.toInt, modes:FDM}),
zHopDistance: UC.newInput("z hop dist", {title: "amount to raise z\non retraction moves\nin millimeters\n0 to disable", bound:UC.bound(0,3.0), convert:UC.toFloat, modes:FDM}),
//detectThinWalls: UC.newBoolean("thin wall fill", onBooleanClick, {title: "detect and fill thin openings\nbetween shells walls", modes:FDM})
gcodeVars: UC.newGroup("gcode", null, {modes:FDM}),

View file

@ -1,7 +1,7 @@
var exports = {
COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen <stewart@neuron.com> - All Rights Reserved",
LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.",
VERSION:"1.1.4"
VERSION:"1.1.5"
};
if (!module) var module = {};
module.exports = exports;