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 || {},
|
||||
process = this.settings.process,
|
||||
accelComp = process.outputAccelComp,
|
||||
shortDist = process.outputShortDistance,
|
||||
shortDist2 = process.outputShortDistance * 2,
|
||||
shortFact = process.outputShortFactor,
|
||||
shellMult = options.extrude || process.outputShellMult,
|
||||
printSpeed = options.rate || process.outputFeedrate,
|
||||
|
|
@ -430,13 +432,16 @@ var gs_kiri_print = exports;
|
|||
if (options.shorten && dist > options.shorten && count === points.length) {
|
||||
point = last.offsetPointFrom(point, options.shorten);
|
||||
}
|
||||
// if (options.accel && dist >= options.accel) {
|
||||
// var p2 = last.offsetPointTo(point, shortDist),
|
||||
// p3 = last.offsetPointFrom(point, shortDist);
|
||||
// segmentOutput(output, last, p2, shortSpeed, printSpeed, 5, shellMult);
|
||||
// addOutput(output, p3, shellMult, printSpeed);
|
||||
// segmentOutput(output, p3, point, printSpeed, shortSpeed, 5, shellMult);
|
||||
// } else
|
||||
if (accelComp && options.accel && dist >= shortDist) {
|
||||
var sl = dist > shortDist2 ? shortDist : dist / 2,
|
||||
ml = dist > shortDist2 ? dist - sl - sl : 0,
|
||||
ps = dist > shortDist2 ? printSpeed : (sl / shortDist) * printSpeed,
|
||||
p2 = last.offsetPointTo(point, sl),
|
||||
p3 = last.offsetPointFrom(point, sl);
|
||||
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) {
|
||||
var shortRate = shortSpeed + (printSpeed - shortSpeed) * (dist / shortDist);
|
||||
addOutput(output, point, shellMult, shortRate);
|
||||
|
|
@ -522,7 +527,7 @@ var gs_kiri_print = exports;
|
|||
var finishShell = poly.depth === 0 && !firstLayer;
|
||||
startPoint = scope.polyPrintPath(poly, startPoint, preout, {
|
||||
rate: finishShell ? process.outputFinishrate : printSpeed,
|
||||
accel: finishShell ? process.outputShortDistance * 2 : 0,
|
||||
accel: finishShell,
|
||||
shorten: finishShell && !firstLayer ? nozzle / 2 : 0,
|
||||
extrude: shellMult,
|
||||
onfirst: function(firstPoint) {
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ self.kiri.license = exports.LICENSE;
|
|||
outputBrimOffset: 1,
|
||||
outputShortDistance: 1,
|
||||
outputShortFactor: 1,
|
||||
outputAccelComp: 1,
|
||||
outputOuterFirst: 1,
|
||||
outputWipeSpeed: 1,
|
||||
outputWipeDistance: 1,
|
||||
|
|
@ -276,6 +277,7 @@ self.kiri.license = exports.LICENSE;
|
|||
outputBrimOffset: 3,
|
||||
outputShortDistance: 5.0,
|
||||
outputShortFactor: 0.2,
|
||||
outputAccelComp: false,
|
||||
outputOuterFirst: true,
|
||||
|
||||
// --- 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}),
|
||||
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}),
|
||||
outputAccelComp: UC.newBoolean("acceleration", onBooleanClick, {title: "acceleration compensation\nexperimental", modes:FDM}),
|
||||
outputOuterFirst: UC.newBoolean("outer first", onBooleanClick, {title: "output outermost shell first", modes:FDM}),
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
var exports = {
|
||||
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.",
|
||||
VERSION:"1.0.72"
|
||||
VERSION:"1.0.73"
|
||||
};
|
||||
if (!module) var module = {};
|
||||
module.exports = exports;
|
||||
|
|
|
|||
Loading…
Reference in a new issue