fixes #279 by adapting retract distance to device nozzle diameter

This commit is contained in:
Stewart Allen 2024-06-24 10:44:13 -04:00
commit b8f938b10c

View file

@ -790,7 +790,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
nozzleSize = process.sliceLineWidth || device.extruders[extruder].extNozzle, nozzleSize = process.sliceLineWidth || device.extruders[extruder].extNozzle,
firstLayer = (opt.first || false) && !opt.support, firstLayer = (opt.first || false) && !opt.support,
thinWall = nozzleSize * (opt.thinWall || 1.75), thinWall = nozzleSize * (opt.thinWall || 1.75),
retractDist = opt.retractOver || 2, retractDist = opt.retractOver || (nozzleSize * 5),
fillMult = opt.mult || process.outputFillMult, fillMult = opt.mult || process.outputFillMult,
shellMult = opt.mult || process.outputShellMult || (process.ctSliceHeight >= 0 ? 1 : 0), shellMult = opt.mult || process.outputShellMult || (process.ctSliceHeight >= 0 ? 1 : 0),
shellOrder = {"out-in":-1,"in-out":1}[process.sliceShellOrder] || -1, shellOrder = {"out-in":-1,"in-out":1}[process.sliceShellOrder] || -1,
@ -1005,6 +1005,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
return false; return false;
} }
// solid infill
function outputTraces(poly, opt = {}) { function outputTraces(poly, opt = {}) {
if (!poly) return; if (!poly) return;
if (Array.isArray(poly)) { if (Array.isArray(poly)) {
@ -1073,6 +1074,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
} }
/** /**
* output sparse infill
* @param {Polygon[]} polys * @param {Polygon[]} polys
*/ */
function outputSparse(polys, extrude, speed) { function outputSparse(polys, extrude, speed) {
@ -1112,6 +1114,9 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
}); });
} }
/**
* convert cross-hatch thin-fill into lines by connecting short segment mid-points
*/
function outputThin(lines) { function outputThin(lines) {
if (!lines) { if (!lines) {
return; return;
@ -1150,6 +1155,11 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
} }
} }
/**
* output solid infill
* @param {*} lines
* @param {*} opt
*/
function outputFills(lines, opt = {}) { function outputFills(lines, opt = {}) {
if (!lines || lines.length === 0) { if (!lines || lines.length === 0) {
return; return;
@ -1166,6 +1176,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
fill = (opt.fill >= 0 ? opt.fill : fillMult) * flow, fill = (opt.fill >= 0 ? opt.fill : fillMult) * flow,
thinDist = near ? thinWall : thinWall; thinDist = near ? thinWall : thinWall;
// continue until all lines in array are "marked" as used
while (lines && marked < lines.length) { while (lines && marked < lines.length) {
group = null; group = null;
found = false; found = false;
@ -1372,6 +1383,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
outputFills(next.fill, {fast: true, near: true}); outputFills(next.fill, {fast: true, near: true});
} }
} else { } else {
// solid infill
let top = next; let top = next;
let isRaft = top.isRaft; let isRaft = top.isRaft;
@ -1449,7 +1461,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
lastTop = next; lastTop = next;
} }
}, function(obj) { }, function(obj) {
// for tops // for tops, return the wrapped poly
return obj instanceof Polygon ? obj : obj.poly; return obj instanceof Polygon ? obj : obj.poly;
}); });