reimagine wipe functionality
This commit is contained in:
parent
76eeb43b5c
commit
98a34c9826
3 changed files with 44 additions and 9 deletions
|
|
@ -447,21 +447,26 @@ var gs_kiri_fdm = exports;
|
|||
moveTo({x:x, y:y, e:emitMM}, outMMM);
|
||||
emitted += emitMM;
|
||||
} else {
|
||||
var moveMMM = seekMMM;
|
||||
// usually wipe speed override
|
||||
if (out.speed) {
|
||||
moveMMM = out.speed * 60;
|
||||
}
|
||||
if (laste && retOver > 0.0 && dist > retOver) {
|
||||
//
|
||||
moveTo({e:-retDist}, retSpeed, "ooze retract");
|
||||
moveTo({x:x, y:y}, seekMMM);
|
||||
moveTo({x:x, y:y}, moveMMM);
|
||||
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);
|
||||
moveTo({x:x, y:y}, moveMMM);
|
||||
}
|
||||
time += (dist / seekMMM) * 60; // seek distance
|
||||
time += (dist / moveMMM) * 60; // seek distance
|
||||
time += (retDist / retSpeed) * 60 * 2; // retraction time
|
||||
// approximate compensation for acceleration & deceleration
|
||||
time += (shortDist * 2) / seekMMM / 10 * 60;
|
||||
time += (shortDist * 2) / moveMMM / 10 * 60;
|
||||
}
|
||||
lastp = out.point;
|
||||
laste = out.emit;
|
||||
|
|
|
|||
|
|
@ -326,9 +326,7 @@ var gs_kiri_print = exports;
|
|||
PRO.polyPrintPath = function(poly, startPoint, output, extrude, onfirst) {
|
||||
poly.setClockwise();
|
||||
|
||||
var mindist = Infinity,
|
||||
closest = poly.findClosestPointTo(startPoint),
|
||||
dist,
|
||||
var closest = poly.findClosestPointTo(startPoint),
|
||||
first = true,
|
||||
settings = this.settings,
|
||||
shellMult = extrude || settings.process.outputShellMult,
|
||||
|
|
@ -368,9 +366,35 @@ var gs_kiri_print = exports;
|
|||
fillMult = process.outputFillMult,
|
||||
shellMult = process.outputShellMult || (process.laserSliceHeight >= 0 ? 1 : 0),
|
||||
sparseMult = process.outputSparseMult,
|
||||
wipeDistance = process.outputWipeDistance,
|
||||
wipeSpeed = process.outputWipeSpeed || 20,
|
||||
origin = startPoint.add(offset),
|
||||
z = slice.z;
|
||||
|
||||
function outputWipe(poly) {
|
||||
var closest = poly.findClosestPointTo(startPoint),
|
||||
distance = wipeDistance,
|
||||
last = startPoint;
|
||||
|
||||
if (!distance) return;
|
||||
|
||||
while (distance > 0) poly.forEachPoint(function(point) {
|
||||
if (distance > 0) {
|
||||
var len = last.distTo2D(point);
|
||||
if (len > distance) {
|
||||
addOutput(preout, point.offsetPointFrom(last, distance), 0, wipeSpeed);
|
||||
distance = 0;
|
||||
} else {
|
||||
addOutput(preout, point, 0, wipeSpeed);
|
||||
distance -= last.distTo2D(point);
|
||||
}
|
||||
last = point;
|
||||
}
|
||||
}, true, closest.index);
|
||||
|
||||
startPoint = preout[preout.length - 1].point;
|
||||
}
|
||||
|
||||
function outputTraces(poly, bounds) {
|
||||
if (!poly) return;
|
||||
if (Array.isArray(poly)) {
|
||||
|
|
@ -522,10 +546,10 @@ var gs_kiri_print = exports;
|
|||
} else {
|
||||
// top object
|
||||
var bounds = POLY.flatten(next.gatherOuter([]));
|
||||
// outputTraces([].appendAll(next.traces).appendAll(next.innerTraces() || []), bounds);
|
||||
outputTraces([].appendAll(next.innerTraces() || []).appendAll(next.traces), bounds);
|
||||
outputTraces([].appendAll(next.traces).appendAll(next.innerTraces() || []), bounds);
|
||||
outputFills(next.fill_lines, bounds);
|
||||
outputSparse(next.fill_sparse, bounds);
|
||||
outputWipe(next.traces.last());
|
||||
}
|
||||
}, function(obj) {
|
||||
return obj instanceof Polygon ? obj : obj.poly;
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ self.kiri.license = exports.LICENSE;
|
|||
outputBrimOffset: 1,
|
||||
outputShortDistance: 1,
|
||||
outputShortFactor: 1,
|
||||
outputWipeSpeed: 1,
|
||||
outputWipeDistance: 1,
|
||||
outputClockwise: 1,
|
||||
outputOriginCenter: 1,
|
||||
outputInvertX: 1,
|
||||
|
|
@ -269,6 +271,8 @@ self.kiri.license = exports.LICENSE;
|
|||
outputRetractOver: 5.0,
|
||||
outputRetractDist: 0.5,
|
||||
outputRetractSpeed: 20,
|
||||
outputWipeSpeed: 20,
|
||||
outputWipeDistance: 0,
|
||||
outputBrimCount: 2,
|
||||
outputBrimOffset: 3,
|
||||
outputShortDistance: 5.0,
|
||||
|
|
@ -2349,6 +2353,8 @@ self.kiri.license = exports.LICENSE;
|
|||
outputRetractOver: UC.newInput("retract over", {title:"retract filament for\nnon-print moves\nover this distance\n0 = 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}),
|
||||
outputWipeSpeed: UC.newInput("wipe speed", {title:"speed while wiping\nnozzle in mm/s", convert:UC.toInt, modes:FDM}),
|
||||
outputWipeDistance: UC.newInput("wipe distance", {title:"distance to wipe nozzle after\neach enclosed island completes\nin millimeters. 0 to disable", convert:UC.toInt, modes:FDM}),
|
||||
outputShortDistance: UC.newInput("short distance", {title:"segment length cutoff\nfor short segments\nin millimeters", bound:UC.bound(0,200), convert:UC.toFloat, modes:FDM}),
|
||||
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}),
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue