fix null end layer bug

This commit is contained in:
Stewart Allen 2018-01-20 22:51:35 -05:00
commit 7e2d6bc060
4 changed files with 7 additions and 4 deletions

View file

@ -1050,7 +1050,7 @@ var gs_base_polygon = exports;
return out;
};
PRO.shortestSegmentLength() {
PRO.shortestSegmentLength = function() {
var len = Infinity;
this.forEachSegment(function(p1, p2) {
len = Math.min(len, p1.distTo2D(p2));

View file

@ -357,7 +357,7 @@ var gs_kiri_fdm = exports;
layer++;
update(layer / maxLayers);
// retract after last layer
if (layer === maxLayers) {
if (layer === maxLayers && layerout.length) {
layerout.last().retract = true;
}

View file

@ -484,6 +484,7 @@ var gs_kiri_print = exports;
minSeek = nozzle * (opt.minSeek || 1.5),
thinWall = nozzle * (opt.thinWall || 1.75),
retractDist = opt.retractOver || 2,
retractDistFill = opt.retractOverSparse || 10,
retractDistSparse = opt.retractOverSparse || 5,
fillMult = opt.mult || process.outputFillMult,
shellMult = opt.mult || process.outputShellMult || (process.laserSliceHeight >= 0 ? 1 : 0),
@ -606,8 +607,8 @@ var gs_kiri_print = exports;
addOutput(preout, p2, fillMult * (find.d / thinWall), fillSpeed);
lastout = 1;
} else {
// retract if dist trigger and crosses a slice top polygon
if (dist > retractDist && intersectsTop(startPoint, p1)) {
// retract if dist trigger or crosses a slice top polygon
if (dist > retractDistFill || intersectsTop(startPoint, p1)) {
retract();
}

View file

@ -59,6 +59,8 @@
# FDM todo
* use fill spacing for top raft fill spacing
* add first layer raft offset (addition)
* fix thin fill
* add pause at specified layers
* fix slow seek to first point (raft) and wrong first point in general (all modes)