improve thin fill areas
This commit is contained in:
parent
37f1cd0910
commit
3fefe08885
5 changed files with 49 additions and 34 deletions
|
|
@ -296,7 +296,6 @@ var gs_kiri_fdm = exports;
|
|||
shortFact = process.outputShortFactor,
|
||||
maxPrintMMM = process.outputFeedrate * 60,
|
||||
seekMMM = process.outputSeekrate * 60,
|
||||
retOver = process.outputRetractOver,
|
||||
retDist = process.outputRetractDist,
|
||||
retSpeed = process.outputRetractSpeed * 60,
|
||||
// ratio of nozzle area to filament area times
|
||||
|
|
@ -371,7 +370,7 @@ var gs_kiri_fdm = exports;
|
|||
if (typeof newpos.e === 'number') {
|
||||
outputLength += newpos.e;
|
||||
if (device.extrudeAbs) {
|
||||
// for flashforge finder that uses cumulative extruder position
|
||||
// for cumulative (absolute) extruder positions
|
||||
o.append(" E").append(UTIL.round(outputLength, decimals));
|
||||
} else {
|
||||
o.append(" E").append(UTIL.round(newpos.e, decimals));
|
||||
|
|
@ -464,7 +463,7 @@ var gs_kiri_fdm = exports;
|
|||
if (out.speed) {
|
||||
moveMMM = out.speed * 60;
|
||||
}
|
||||
if (out.retract || (laste && retOver > 0.0 && dist > retOver)) {
|
||||
if (out.retract) {
|
||||
retracted = retDist;
|
||||
moveTo({e:-retracted}, retSpeed, "retract (ooze control)");
|
||||
moveTo({x:x, y:y}, moveMMM);
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ var gs_kiri_print = exports;
|
|||
return;
|
||||
}
|
||||
if (lastPoint && UTIL.round(point.x,4) == UTIL.round(lastPoint.x,4) && UTIL.round(point.y,4) == UTIL.round(lastPoint.y,4)) {
|
||||
console.log(({dup:point, last:lastPoint}));
|
||||
// console.log(({dup:point, last:lastPoint}));
|
||||
}
|
||||
lastPoint = point;
|
||||
lastEmit = emit;
|
||||
|
|
@ -374,7 +374,10 @@ var gs_kiri_print = exports;
|
|||
scope = this,
|
||||
settings = this.settings,
|
||||
process = settings.process,
|
||||
minSeek = settings.device.nozzleSize * 1.5,
|
||||
nozzle = settings.device.nozzleSize,
|
||||
minSeek = nozzle * 1.5,
|
||||
thinWall = nozzle * 1.75,
|
||||
fillSkip = nozzle * 5,
|
||||
fillMult = process.outputFillMult,
|
||||
shellMult = process.outputShellMult || (process.laserSliceHeight >= 0 ? 1 : 0),
|
||||
sparseMult = process.outputSparseMult,
|
||||
|
|
@ -477,21 +480,28 @@ var gs_kiri_print = exports;
|
|||
}
|
||||
|
||||
function outputFills(lines, bounds) {
|
||||
var mindist, p1, p2, dist, point, find, dist;
|
||||
var mindist, p1, p2, dist, dsave, point, find, find2, len, lastout;
|
||||
while (lines) {
|
||||
find = null;
|
||||
find2 = null;
|
||||
mindist = Infinity;
|
||||
// find next closes line
|
||||
for (i=0; i<lines.length; i++) {
|
||||
point = lines[i];
|
||||
if (point.del) continue;
|
||||
dist = SQRT(startPoint.distToSq2D(point));
|
||||
dist = startPoint.distTo2D(point);
|
||||
if (dist < mindist) {
|
||||
find = {i:i, p:point};
|
||||
find2 = find;
|
||||
find = {i:i, p:point, d:dist};
|
||||
mindist = dist;
|
||||
}
|
||||
}
|
||||
if (find) {
|
||||
// do 2nd closest fill lines within bigger fill areas
|
||||
// if (find2 && lastout === 2 && len > thinWall && find2.d < fillSkip) {
|
||||
// find = find2;
|
||||
// }
|
||||
|
||||
// order segment by closest to farthest point
|
||||
if (find.i % 2 === 0) {
|
||||
p1 = find.p;
|
||||
|
|
@ -500,19 +510,33 @@ var gs_kiri_print = exports;
|
|||
p1 = find.p;
|
||||
p2 = lines[find.i - 1];
|
||||
}
|
||||
|
||||
// mark as used (temporary)
|
||||
p1.del = true;
|
||||
p2.del = true;
|
||||
dist = SQRT(startPoint.distToSq2D(p1));
|
||||
dist = startPoint.distTo2D(p1);
|
||||
len = p1.distTo2D(p2);
|
||||
|
||||
// check for intersection with bounds and if found
|
||||
// follow the shortest path around that bounding poly
|
||||
if (bounds && startPoint && dist > minSeek) {
|
||||
checkBisect(startPoint, p1, bounds);
|
||||
// if dist to new segment is less than thinWall
|
||||
// and segment length is less than thinWall then
|
||||
// just extrude to midpoint of next segment. this is
|
||||
// to avoid shaking printer to death.
|
||||
if (mindist <= thinWall && len <= thinWall) {
|
||||
p2 = p1.midPointTo(p2);
|
||||
addOutput(preout, p2, fillMult * (mindist / thinWall));
|
||||
lastout = 1;
|
||||
} else {
|
||||
// check for intersection with bounds and if found
|
||||
// follow the shortest path around that bounding poly
|
||||
if (bounds && startPoint && dist > minSeek) {
|
||||
checkBisect(startPoint, p1, bounds);
|
||||
}
|
||||
|
||||
addOutput(preout, p1, 0);
|
||||
addOutput(preout, p2, fillMult);
|
||||
lastout = 2;
|
||||
}
|
||||
|
||||
addOutput(preout, p1, 0);
|
||||
addOutput(preout, p2, fillMult);
|
||||
startPoint = p2;
|
||||
} else {
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -70,10 +70,8 @@ self.kiri.license = exports.LICENSE;
|
|||
outputFinishrate: 1,
|
||||
outputSeekrate: 1,
|
||||
outputShellMult: 1,
|
||||
// outputShellSpeed: 1,
|
||||
outputFillMult: 1,
|
||||
outputSparseMult: 1,
|
||||
outputRetractOver: 1,
|
||||
outputRetractDist: 1,
|
||||
outputRetractSpeed: 1,
|
||||
outputBrimCount: 1,
|
||||
|
|
@ -265,10 +263,8 @@ self.kiri.license = exports.LICENSE;
|
|||
outputFinishrate: 60,
|
||||
outputSeekrate: 150,
|
||||
outputShellMult: 1.0,
|
||||
// outputShellSpeed: 1.0,
|
||||
outputFillMult: 1.25,
|
||||
outputSparseMult: 1.5,
|
||||
outputRetractOver: 5.0,
|
||||
outputRetractDist: 0.5,
|
||||
outputRetractSpeed: 20,
|
||||
outputWipeSpeed: 20,
|
||||
|
|
@ -2313,7 +2309,7 @@ self.kiri.license = exports.LICENSE;
|
|||
outputTemp: UC.newInput("nozzle temp", {title:"degrees celsius", convert:UC.toInt, modes:FDM}),
|
||||
outputFeedrate: UC.newInput("print speed", {title:"print move max speed\nmillimeters / minute", convert:UC.toInt, modes:FDM}),
|
||||
outputFinishrate: UC.newInput("finish speed", {title:"outermost shell speed\nmillimeters / minute", convert:UC.toInt, modes:FDM}),
|
||||
outputSeekrate: UC.newInput("move speed", {title:"non-print move max speed\nmillimeters / minute", convert:UC.toInt, modes:FDM}),
|
||||
outputSeekrate: UC.newInput("move speed", {title:"non-print move speed\nmillimeters / minute", convert:UC.toInt, modes:FDM}),
|
||||
// outputShellSpeed: UC.newInput("shell speed", {title:"speed multiplier\n0.1 - 2.0", convert:UC.toFloat, bound:UC.bound(0.1,2.0), modes:FDM}),
|
||||
outputShellMult: UC.newInput("shell factor", {title:"extrusion multiplier\n0.0 - 2.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}),
|
||||
outputFillMult: UC.newInput("solid factor", {title:"extrusion multiplier\n0.0 - 2.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}),
|
||||
|
|
@ -2353,7 +2349,6 @@ self.kiri.license = exports.LICENSE;
|
|||
outputBrimOffset: UC.newInput("skirt offset", {title:"millimeters", convert:UC.toFloat, modes:FDM}),
|
||||
|
||||
advanced: UC.newGroup("advanced", null, {modes:FDM}),
|
||||
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}),
|
||||
|
|
|
|||
Loading…
Reference in a new issue