diff --git a/js/kiri-print.js b/js/kiri-print.js index 1da9c9f0..130da4c2 100644 --- a/js/kiri-print.js +++ b/js/kiri-print.js @@ -217,7 +217,7 @@ var gs_kiri_print = exports; newlayer = []; newout.push(newlayer); layerout.forEach(function(out) { - if (out.point) newlayer.push({emit:out.emit, point:{x:out.point.x, y:out.point.y, z:out.point.z}}); + if (out.point) newlayer.push({emit:out.emit, speed:out.speed, point:{x:out.point.x, y:out.point.y, z:out.point.z}}); }); }); return newout; @@ -314,6 +314,7 @@ var gs_kiri_print = exports; } /** + * FDM only. add points in polygon to an output array (print path) * * @param {Polygon} poly * @param {Point} startPoint @@ -330,16 +331,17 @@ var gs_kiri_print = exports; dist, first = true, settings = this.settings, - shellMult = extrude || settings.process.outputShellMult; + shellMult = extrude || settings.process.outputShellMult, + shellSpeed = settings.process.outputShellSpeedMult || 1; poly.forEachPoint(function(point) { if (first) { if (onfirst) onfirst(point); // move from startPoint to point - addOutput(output, point, 0); + addOutput(output, point, 0, 1); first = false; } else { - addOutput(output, point, shellMult); + addOutput(output, point, shellMult, poly.depth == 0 ? shellSpeed : 1); } }, true, closest.index); @@ -520,7 +522,8 @@ 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.traces).appendAll(next.innerTraces() || []), bounds); + outputTraces([].appendAll(next.innerTraces() || []).appendAll(next.traces), bounds); outputFills(next.fill_lines, bounds); outputSparse(next.fill_sparse, bounds); } diff --git a/js/kiri-slice.js b/js/kiri-slice.js index 29741e4a..25a2f717 100644 --- a/js/kiri-slice.js +++ b/js/kiri-slice.js @@ -376,7 +376,13 @@ var gs_kiri_slice = exports; POLY.expand([top.poly], -offset1, top.poly.getZ(), top.traces, count, -offsetN, function(polys, countNow) { last = polys; // mark each poly with depth (offset #) starting at 0 - polys.forEach(function(p) { p.depth = count - countNow }); + polys.forEach(function(p) { + p.depth = count - countNow; + if (p.inner) p.inner.forEach(function(pi) { + // use negative offset for inners + pi.depth = -(count - countNow); + }); + }); }); } } diff --git a/js/kiri.js b/js/kiri.js index e6f0d4c0..8e5cf036 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -72,6 +72,7 @@ self.kiri.license = exports.LICENSE; // outputShellSpeed: 1, outputFillMult: 1, outputSparseMult: 1, + outputShellSpeedMult: 1, outputRetractOver: 1, outputRetractDist: 1, outputRetractSpeed: 1, @@ -264,6 +265,7 @@ self.kiri.license = exports.LICENSE; // outputShellSpeed: 1.0, outputFillMult: 1.25, outputSparseMult: 1.5, + outputShellSpeedMult: 1.0, outputRetractOver: 5.0, outputRetractDist: 0.5, outputRetractSpeed: 20, @@ -2308,6 +2310,7 @@ self.kiri.license = exports.LICENSE; 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}), outputSparseMult: UC.newInput("infill factor", {title:"extrusion multiplier\n0.0 - 2.0", convert:UC.toFloat, bound:UC.bound(0.0,2.0), modes:FDM}), + outputShellSpeedMult: UC.newInput("finish factor", {title:"outermost shell speed multiplier\n0.0 - 1.0", convert:UC.toFloat, bound:UC.bound(0.0,1.0), modes:FDM}), // cam camTolerance: UC.newInput("tolerance", {title:"surface precision\nin millimeters", convert:UC.toFloat, bound:UC.bound(0.05,1.0), modes:CAM}),