add experimental acceleration compensation
This commit is contained in:
parent
228165e021
commit
7550e8dc81
3 changed files with 17 additions and 9 deletions
|
|
@ -409,7 +409,9 @@ var gs_kiri_print = exports;
|
||||||
|
|
||||||
var options = options || {},
|
var options = options || {},
|
||||||
process = this.settings.process,
|
process = this.settings.process,
|
||||||
|
accelComp = process.outputAccelComp,
|
||||||
shortDist = process.outputShortDistance,
|
shortDist = process.outputShortDistance,
|
||||||
|
shortDist2 = process.outputShortDistance * 2,
|
||||||
shortFact = process.outputShortFactor,
|
shortFact = process.outputShortFactor,
|
||||||
shellMult = options.extrude || process.outputShellMult,
|
shellMult = options.extrude || process.outputShellMult,
|
||||||
printSpeed = options.rate || process.outputFeedrate,
|
printSpeed = options.rate || process.outputFeedrate,
|
||||||
|
|
@ -430,13 +432,16 @@ var gs_kiri_print = exports;
|
||||||
if (options.shorten && dist > options.shorten && count === points.length) {
|
if (options.shorten && dist > options.shorten && count === points.length) {
|
||||||
point = last.offsetPointFrom(point, options.shorten);
|
point = last.offsetPointFrom(point, options.shorten);
|
||||||
}
|
}
|
||||||
// if (options.accel && dist >= options.accel) {
|
if (accelComp && options.accel && dist >= shortDist) {
|
||||||
// var p2 = last.offsetPointTo(point, shortDist),
|
var sl = dist > shortDist2 ? shortDist : dist / 2,
|
||||||
// p3 = last.offsetPointFrom(point, shortDist);
|
ml = dist > shortDist2 ? dist - sl - sl : 0,
|
||||||
// segmentOutput(output, last, p2, shortSpeed, printSpeed, 5, shellMult);
|
ps = dist > shortDist2 ? printSpeed : (sl / shortDist) * printSpeed,
|
||||||
// addOutput(output, p3, shellMult, printSpeed);
|
p2 = last.offsetPointTo(point, sl),
|
||||||
// segmentOutput(output, p3, point, printSpeed, shortSpeed, 5, shellMult);
|
p3 = last.offsetPointFrom(point, sl);
|
||||||
// } else
|
segmentOutput(output, last, p2, shortSpeed, ps, 5, shellMult);
|
||||||
|
if (ml) addOutput(output, p3, shellMult, printSpeed);
|
||||||
|
segmentOutput(output, p3, point, ps, shortSpeed, 5, shellMult);
|
||||||
|
} else
|
||||||
if (shortDist && dist < shortDist) {
|
if (shortDist && dist < shortDist) {
|
||||||
var shortRate = shortSpeed + (printSpeed - shortSpeed) * (dist / shortDist);
|
var shortRate = shortSpeed + (printSpeed - shortSpeed) * (dist / shortDist);
|
||||||
addOutput(output, point, shellMult, shortRate);
|
addOutput(output, point, shellMult, shortRate);
|
||||||
|
|
@ -522,7 +527,7 @@ var gs_kiri_print = exports;
|
||||||
var finishShell = poly.depth === 0 && !firstLayer;
|
var finishShell = poly.depth === 0 && !firstLayer;
|
||||||
startPoint = scope.polyPrintPath(poly, startPoint, preout, {
|
startPoint = scope.polyPrintPath(poly, startPoint, preout, {
|
||||||
rate: finishShell ? process.outputFinishrate : printSpeed,
|
rate: finishShell ? process.outputFinishrate : printSpeed,
|
||||||
accel: finishShell ? process.outputShortDistance * 2 : 0,
|
accel: finishShell,
|
||||||
shorten: finishShell && !firstLayer ? nozzle / 2 : 0,
|
shorten: finishShell && !firstLayer ? nozzle / 2 : 0,
|
||||||
extrude: shellMult,
|
extrude: shellMult,
|
||||||
onfirst: function(firstPoint) {
|
onfirst: function(firstPoint) {
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
outputBrimOffset: 1,
|
outputBrimOffset: 1,
|
||||||
outputShortDistance: 1,
|
outputShortDistance: 1,
|
||||||
outputShortFactor: 1,
|
outputShortFactor: 1,
|
||||||
|
outputAccelComp: 1,
|
||||||
outputOuterFirst: 1,
|
outputOuterFirst: 1,
|
||||||
outputWipeSpeed: 1,
|
outputWipeSpeed: 1,
|
||||||
outputWipeDistance: 1,
|
outputWipeDistance: 1,
|
||||||
|
|
@ -276,6 +277,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
outputBrimOffset: 3,
|
outputBrimOffset: 3,
|
||||||
outputShortDistance: 5.0,
|
outputShortDistance: 5.0,
|
||||||
outputShortFactor: 0.2,
|
outputShortFactor: 0.2,
|
||||||
|
outputAccelComp: false,
|
||||||
outputOuterFirst: true,
|
outputOuterFirst: true,
|
||||||
|
|
||||||
// --- LASER ---
|
// --- LASER ---
|
||||||
|
|
@ -2362,6 +2364,7 @@ self.kiri.license = exports.LICENSE;
|
||||||
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}),
|
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}),
|
||||||
outputShortDistance: UC.newInput("short distance", {title:"segment length cutoff\nfor short segments\nin millimeters", bound:UC.bound(0,200), convert:UC.toFloat, modes:FDM}),
|
outputShortDistance: UC.newInput("short distance", {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}),
|
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}),
|
||||||
|
outputAccelComp: UC.newBoolean("acceleration", onBooleanClick, {title: "acceleration compensation\nexperimental", modes:FDM}),
|
||||||
outputOuterFirst: UC.newBoolean("outer first", onBooleanClick, {title: "output outermost shell first", modes:FDM}),
|
outputOuterFirst: UC.newBoolean("outer first", onBooleanClick, {title: "output outermost shell first", modes:FDM}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
var exports = {
|
var exports = {
|
||||||
COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen <stewart@neuron.com> - All Rights Reserved",
|
COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen <stewart@neuron.com> - All Rights Reserved",
|
||||||
LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.",
|
LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.",
|
||||||
VERSION:"1.0.72"
|
VERSION:"1.0.73"
|
||||||
};
|
};
|
||||||
if (!module) var module = {};
|
if (!module) var module = {};
|
||||||
module.exports = exports;
|
module.exports = exports;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue