From 3fefe0888532bd8ab35ca484066eab9a5053b0da Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 8 Dec 2017 13:27:15 -0500 Subject: [PATCH] improve thin fill areas --- js/kiri-driver-fdm.js | 5 ++-- js/kiri-print.js | 48 +++++++++++++++++++++++++--------- js/kiri.js | 7 +---- notes.md | 14 ++++------ web/kiri/filter/FDM/Raise3D.N2 | 7 ++--- 5 files changed, 48 insertions(+), 33 deletions(-) diff --git a/js/kiri-driver-fdm.js b/js/kiri-driver-fdm.js index db7ca49e..783f1d82 100644 --- a/js/kiri-driver-fdm.js +++ b/js/kiri-driver-fdm.js @@ -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); diff --git a/js/kiri-print.js b/js/kiri-print.js index 2b1146f1..6986e16f 100644 --- a/js/kiri-print.js +++ b/js/kiri-print.js @@ -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 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; diff --git a/js/kiri.js b/js/kiri.js index 0792db07..8ea56edf 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -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}), diff --git a/notes.md b/notes.md index 41c27fa0..5032bd9d 100644 --- a/notes.md +++ b/notes.md @@ -58,25 +58,21 @@ # FDM todo -* add lay-flat auto-rotation +* solid fill every other line, two passes. minimize heat/sag. better fill between +* add lay-flat auto-rotation or from selected face * add dashed poly output on first connected brim (when offset === 0) -* implement gyroid infill * https://en.wikipedia.org/wiki/Gyroid +* add hold down fingers option on brim (when offset !== 0) * fan / layer control * update forum * infill rendering as moves instead of extrusions (firefox?) -* run line through center of series of short fills (thin fill optimization) * add rafts, thin wall detection, manual supports * add skirt to raft option as a simpler way to do rafts -* separate shell speed control -* wipe on infill should follow the closest enclosing shell poly +* dual extruder support * add TAZ profile from https://code.alephobjects.com/diffusion/P/browse/master/cura/TAZ_flexy_dually_v2/PLA-PVA-support_medium-quality_TAZ_FlexyDually-v2_0.6noz_cura.ini -* add control of shortest line/fill line before culling -* add retraction distance/speed to device profiles * add min layer time (slowdown or cool-off wait) -* tops should print inside/out (add odds w/ poly2poly ...) * option to support interior bridges when 0% infill * fix multiple part layout export offset (resend position @ print time) * check for support / brim intersections on first layer -* dual extruder support +* implement gyroid infill * https://en.wikipedia.org/wiki/Gyroid # Laser todo diff --git a/web/kiri/filter/FDM/Raise3D.N2 b/web/kiri/filter/FDM/Raise3D.N2 index c03cf3ed..43d3bc01 100644 --- a/web/kiri/filter/FDM/Raise3D.N2 +++ b/web/kiri/filter/FDM/Raise3D.N2 @@ -16,7 +16,8 @@ "G92 E0", "G1 X10 F600", "G1 F140 E29", - "G1 Y40 F3000", + "G1 F600 E28", + "G1 Y20 Z0.05 F2000", ";G92 E0", "G1 F6000.00", "M117 Printing...", @@ -41,8 +42,8 @@ "settings":{ "origin_center": false, "extrude_abs": true, - "bed_width": 305, - "bed_depth": 305, + "bed_width": 310, + "bed_depth": 310, "build_height": 305 } }