remove checkBisect and wipe on retract
This commit is contained in:
parent
531fdd28d3
commit
cdfa2456e4
3 changed files with 2 additions and 73 deletions
|
|
@ -489,8 +489,6 @@ var gs_kiri_print = exports;
|
|||
fillMult = opt.mult || process.outputFillMult,
|
||||
shellMult = opt.mult || process.outputShellMult || (process.laserSliceHeight >= 0 ? 1 : 0),
|
||||
sparseMult = process.outputSparseMult,
|
||||
wipeDistance = process.outputWipeDistance,
|
||||
wipeSpeed = process.outputWipeSpeed || 20,
|
||||
finishFactor = process.outputFinishFactor || 0,
|
||||
finishSpeed = opt.speed || process.outputFinishrate,
|
||||
printSpeed = opt.speed || (firstLayer ? process.firstLayerRate : process.outputFeedrate),
|
||||
|
|
@ -503,31 +501,6 @@ var gs_kiri_print = exports;
|
|||
if (preout.length) preout.last().retract = true;
|
||||
}
|
||||
|
||||
function outputWipe(poly) {
|
||||
retract();
|
||||
|
||||
if (!poly || !wipeDistance) return;
|
||||
|
||||
var closest = poly.findClosestPointTo(startPoint),
|
||||
distance = wipeDistance,
|
||||
last = startPoint;
|
||||
while (distance > 0) poly.forEachPoint(function(point) {
|
||||
if (distance > 0) {
|
||||
var len = last.distTo2D(point);
|
||||
if (len > distance) {
|
||||
addOutput(preout, point.offsetPointFrom(last, distance), 0, wipeSpeed);
|
||||
distance = 0;
|
||||
} else {
|
||||
addOutput(preout, point, 0, wipeSpeed);
|
||||
distance -= last.distTo2D(point);
|
||||
}
|
||||
last = point;
|
||||
}
|
||||
}, true, closest.index);
|
||||
|
||||
startPoint = preout[preout.length - 1].point;
|
||||
}
|
||||
|
||||
function outputTraces(poly, bounds) {
|
||||
if (!poly) return;
|
||||
if (Array.isArray(poly)) {
|
||||
|
|
@ -543,44 +516,11 @@ var gs_kiri_print = exports;
|
|||
extrude: shellMult,
|
||||
onfirst: function(firstPoint) {
|
||||
if (startPoint.distTo2D(firstPoint) > retractDist) retract();
|
||||
// checkBisect(startPoint, firstPoint, bounds);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function checkBisect(p1, p2, bounds) {
|
||||
if (!bounds || p1.distTo2D(p2) < minSeek) return;
|
||||
var routes = [];
|
||||
// find bisections and choose shortest
|
||||
bounds.forEach(function(bp) {
|
||||
var paths = bp.bisect(p1, p2);
|
||||
if (!paths || paths.length !== 2) return;
|
||||
var path = paths[0].perimeter() < paths[1].perimeter() ? paths[0] : paths[1];
|
||||
if (p1.distTo2D(path.first() > p1.distTo2D(path.last()))) path.reverse();
|
||||
// cull phantom and short paths
|
||||
if (path.perimeter() > 0.1) routes.push(path);
|
||||
});
|
||||
// sort bisecting paths by those closest to start point (p1)
|
||||
routes.sort((function(o1, o2) {
|
||||
var d1 = Math.min(
|
||||
o1.first().distTo2D(p1),
|
||||
o1.last().distTo2D(p1)
|
||||
);
|
||||
var d2 = Math.min(
|
||||
o2.first().distTo2D(p1),
|
||||
o2.last().distTo2D(p1)
|
||||
);
|
||||
return d1 - d2;
|
||||
}));
|
||||
// output non-printing bisecting paths
|
||||
routes.forEach(function(path) {
|
||||
path.forEachPoint(function(p) {
|
||||
addOutput(preout, p, 0, moveSpeed);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Polygon[]} polys
|
||||
*/
|
||||
|
|
@ -594,7 +534,6 @@ var gs_kiri_print = exports;
|
|||
var poly = el.poly;
|
||||
if (poly.last() === point) poly.reverse();
|
||||
poly.forEachPoint(function(p, i) {
|
||||
// if (i === 0 && lp) checkBisect(lp, p, bounds);
|
||||
if (i === 0 && lp && lp.distTo2D(p) > retractDistSparse) retract();
|
||||
addOutput(preout, p, i === 0 ? 0 : sparseMult, printSpeed);
|
||||
lp = p;
|
||||
|
|
@ -644,12 +583,6 @@ var gs_kiri_print = exports;
|
|||
} else {
|
||||
if (dist > retractDist) retract();
|
||||
|
||||
// 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);
|
||||
// }
|
||||
|
||||
// bridge ends of fill when they're close together
|
||||
if (dist < thinWall) {
|
||||
addOutput(preout, p1, fillMult, printSpeed);
|
||||
|
|
|
|||
|
|
@ -96,8 +96,6 @@ self.kiri.license = exports.LICENSE;
|
|||
outputCooling: 1,
|
||||
outputOuterFirst: 1,
|
||||
detectThinWalls: 1,
|
||||
outputWipeSpeed: 1,
|
||||
outputWipeDistance: 1,
|
||||
outputClockwise: 1,
|
||||
outputOriginCenter: 1,
|
||||
outputInvertX: 1,
|
||||
|
|
@ -293,8 +291,6 @@ self.kiri.license = exports.LICENSE;
|
|||
outputRetractDist: 0.5,
|
||||
outputRetractSpeed: 20,
|
||||
outputRetractDwell: 50,
|
||||
outputWipeSpeed: 50,
|
||||
outputWipeDistance: 0,
|
||||
outputBrimCount: 2,
|
||||
outputBrimOffset: 3,
|
||||
outputShortPoly: 15.0,
|
||||
|
|
@ -2408,8 +2404,6 @@ self.kiri.license = exports.LICENSE;
|
|||
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}),
|
||||
outputRetractDwell: UC.newInput("retract dwell", {title:"time between re-engaging\nfilament and movement\nin milliseconds", convert:UC.toInt, modes:FDM}),
|
||||
outputWipeSpeed: UC.newInput("wipe speed", {title:"speed while wiping\nnozzle in mm/s", convert:UC.toInt, modes:FDM}),
|
||||
outputWipeDistance: UC.newInput("wipe distance", {title:"distance to wipe nozzle after\neach enclosed island completes\nin millimeters. 0 to disable", convert:UC.toInt, modes:FDM}),
|
||||
outputShortPoly: UC.newInput("short outline", {title:"poly perimeter length\ntriggers short slowdown\nin millimeters", bound:UC.bound(0,200), convert:UC.toFloat, modes:FDM}),
|
||||
outputShortDistance: UC.newInput("short segment", {title:"segment length cutoff\nfor short segments\nin millimeters", bound:UC.bound(0,200), convert:UC.toFloat, modes:FDM}),
|
||||
outputShortFactor: UC.newInput("short factor", {title:"max speed reduction factor\nfor short segments\nas % of print speed", bound:UC.bound(0.05,1), convert:UC.toFloat, modes:FDM}),
|
||||
|
|
|
|||
2
notes.md
2
notes.md
|
|
@ -59,6 +59,8 @@
|
|||
|
||||
# FDM todo
|
||||
|
||||
* fix thin fill
|
||||
* convert moves to G0 (where supported)
|
||||
* fix slow seek to first point (raft) and wrong first point in general (all modes)
|
||||
* add lay-flat auto-rotation or from selected face
|
||||
* determine start point from gcode preamble
|
||||
|
|
|
|||
Loading…
Reference in a new issue