off tower pause for belt. progressive speed increase on tower preamble
This commit is contained in:
parent
5604c93a80
commit
e8fd141a27
3 changed files with 47 additions and 28 deletions
|
|
@ -484,7 +484,10 @@
|
||||||
options.onfirst(point);
|
options.onfirst(point);
|
||||||
}
|
}
|
||||||
// move to first output point on poly
|
// move to first output point on poly
|
||||||
addOutput(output, point, 0, moveSpeed, tool);
|
let out = addOutput(output, point, 0, moveSpeed, tool);
|
||||||
|
if (options.onfirstout) {
|
||||||
|
options.onfirstout(out);
|
||||||
|
}
|
||||||
first = false;
|
first = false;
|
||||||
} else {
|
} else {
|
||||||
let seglen = last.distTo2D(point);
|
let seglen = last.distTo2D(point);
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,10 @@
|
||||||
paletteInfo = extras.palette || {},
|
paletteInfo = extras.palette || {},
|
||||||
palettePingStart = paletteInfo.ping / 2,
|
palettePingStart = paletteInfo.ping / 2,
|
||||||
palettePingSpace = paletteInfo.ping || 0,
|
palettePingSpace = paletteInfo.ping || 0,
|
||||||
segments = [];
|
segments = [],
|
||||||
|
// track purges for palette3 pings
|
||||||
|
purgeOff = 0,
|
||||||
|
purgeOn;
|
||||||
|
|
||||||
// smallish band-aid. refactor above to remove redundancy
|
// smallish band-aid. refactor above to remove redundancy
|
||||||
function updateParams(layer) {
|
function updateParams(layer) {
|
||||||
|
|
@ -339,6 +342,16 @@
|
||||||
let taxis = new THREE.Vector3( 1, 0, 0 );
|
let taxis = new THREE.Vector3( 1, 0, 0 );
|
||||||
let tcent = new THREE.Vector2( 0, 0 );
|
let tcent = new THREE.Vector2( 0, 0 );
|
||||||
let angle = -Math.PI / 4;
|
let angle = -Math.PI / 4;
|
||||||
|
let savePos = pos;
|
||||||
|
|
||||||
|
function pushPos(newpos, rate, comment) {
|
||||||
|
savePos = Object.clone(pos);
|
||||||
|
moveTo(newpos, rate, comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
function popPos(rate, comment) {
|
||||||
|
moveTo(savePos, rate, comment);
|
||||||
|
}
|
||||||
|
|
||||||
function moveTo(newpos, rate, comment) {
|
function moveTo(newpos, rate, comment) {
|
||||||
let o = [!rate && !newpos.e ? 'G0' : 'G1'];
|
let o = [!rate && !newpos.e ? 'G0' : 'G1'];
|
||||||
|
|
@ -495,10 +508,6 @@
|
||||||
moveTo({z:zpos}, seekMMM);
|
moveTo({z:zpos}, seekMMM);
|
||||||
}
|
}
|
||||||
|
|
||||||
// track purges for palette3 pings
|
|
||||||
let purgeOn;
|
|
||||||
let purgeOff = 0;
|
|
||||||
|
|
||||||
// iterate through layer outputs
|
// iterate through layer outputs
|
||||||
for (pidx=0; pidx<path.length; pidx++) {
|
for (pidx=0; pidx<path.length; pidx++) {
|
||||||
out = path[pidx];
|
out = path[pidx];
|
||||||
|
|
@ -510,34 +519,31 @@
|
||||||
if (isPalette && palettePingSpace && emitted >= palettePingStart) {
|
if (isPalette && palettePingSpace && emitted >= palettePingStart) {
|
||||||
if (out.point.purgeOn && (purgeOff === 0 || emitted - purgeOff >= palettePingSpace)) {
|
if (out.point.purgeOn && (purgeOff === 0 || emitted - purgeOff >= palettePingSpace)) {
|
||||||
retract();
|
retract();
|
||||||
// for (let i=0; i<13; i++) {
|
if (isBelt) pushPos({x:195});
|
||||||
// append(`G4 P1000`);
|
|
||||||
// if (i < 12) append('G1');
|
|
||||||
// }
|
|
||||||
append(`G4 P4000`); append('G1');
|
append(`G4 P4000`); append('G1');
|
||||||
append(`G4 P4000`); append('G1');
|
append(`G4 P4000`); append('G1');
|
||||||
append(`G4 P4000`); append('G1');
|
append(`G4 P4000`); append('G1');
|
||||||
append(`G4 P1000`);
|
append(`G4 P1000`);
|
||||||
|
if (isBelt) popPos();
|
||||||
unretract();
|
unretract();
|
||||||
purgeOn = emitted;
|
purgeOn = emitted;
|
||||||
}
|
}
|
||||||
if (purgeOn && out.point.purgeOff) {
|
if (purgeOn && out.point.purgeOff) {
|
||||||
retract();
|
retract();
|
||||||
// for (let i=0; i<7; i++) {
|
if (isBelt) pushPos({x:195});
|
||||||
// append(`G4 P1000`);
|
|
||||||
// if (i < 6) append('G1');
|
|
||||||
// }
|
|
||||||
append(`G4 P4000`); append('G1');
|
append(`G4 P4000`); append('G1');
|
||||||
append(`G4 P3000`);
|
append(`G4 P3000`);
|
||||||
|
if (isBelt) popPos();
|
||||||
unretract();
|
unretract();
|
||||||
purgeOff = emitted;
|
|
||||||
if (!print.purges) {
|
if (!print.purges) {
|
||||||
print.purges = [];
|
print.purges = [];
|
||||||
}
|
}
|
||||||
print.purges.push({
|
print.purges.push({
|
||||||
length: purgeOn,
|
length: purgeOn,
|
||||||
extrusion: purgeOff - purgeOn
|
extrusion: emitted - purgeOn
|
||||||
});
|
});
|
||||||
|
purgeOff = emitted;
|
||||||
|
purgeOn = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -340,6 +340,7 @@
|
||||||
let tool = using >= 0 ? using : nozzle;
|
let tool = using >= 0 ? using : nozzle;
|
||||||
let first = isBelt ? !purgedFirst && layer.slice.index >= 0 : layer.slice.index === 0;
|
let first = isBelt ? !purgedFirst && layer.slice.index >= 0 : layer.slice.index === 0;
|
||||||
let rate = first ? process.firstLayerRate : process.outputFeedrate;
|
let rate = first ? process.firstLayerRate : process.outputFeedrate;
|
||||||
|
let wipe = true;
|
||||||
lastPurgeTool = tool;
|
lastPurgeTool = tool;
|
||||||
if (rec) {
|
if (rec) {
|
||||||
track[nozzle] = null;
|
track[nozzle] = null;
|
||||||
|
|
@ -352,6 +353,8 @@
|
||||||
let scale = 1 - ((z / zmin));
|
let scale = 1 - ((z / zmin));
|
||||||
mkblok(blokw * scale, blokh);
|
mkblok(blokw * scale, blokh);
|
||||||
rec = mkrec(rec.extruder, 0, 10);
|
rec = mkrec(rec.extruder, 0, 10);
|
||||||
|
rate = (process.outputFeedrate - process.firstLayerRate) * scale + process.firstLayerRate;
|
||||||
|
wipe = false;
|
||||||
}
|
}
|
||||||
let box = rec.rect.clone().setZ(z);
|
let box = rec.rect.clone().setZ(z);
|
||||||
let fill = (z >= 0 && purgeOn ? rec.full : rec.sparse).clone().setZ(z);
|
let fill = (z >= 0 && purgeOn ? rec.full : rec.sparse).clone().setZ(z);
|
||||||
|
|
@ -359,8 +362,9 @@
|
||||||
box.move({x:0, y:z, z:0});
|
box.move({x:0, y:z, z:0});
|
||||||
if (fill) fill.move({x:0, y:z, z:0});
|
if (fill) fill.move({x:0, y:z, z:0});
|
||||||
if (offset) {
|
if (offset) {
|
||||||
box.move(offset);
|
let bo = { x:0, y:offset.y, z:offset.z };
|
||||||
if (fill) fill.move(offset);
|
box.move(bo);
|
||||||
|
if (fill) fill.move(bo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
start = print.polyPrintPath(box, start, layer, {
|
start = print.polyPrintPath(box, start, layer, {
|
||||||
|
|
@ -368,23 +372,27 @@
|
||||||
rate,
|
rate,
|
||||||
simple: true,
|
simple: true,
|
||||||
open: false,
|
open: false,
|
||||||
|
onfirstout: (out => out.overate = (isBelt ? rate : 0))
|
||||||
});
|
});
|
||||||
if (fill && fill.length) start = print.polyPrintPath(fill, start, layer, {
|
if (fill && fill.length) {
|
||||||
tool,
|
start = print.polyPrintPath(fill, start, layer, {
|
||||||
rate,
|
tool,
|
||||||
simple: true,
|
rate,
|
||||||
open: true,
|
simple: true,
|
||||||
onfirst: (point) => { point.purgeOn = purgeOn }
|
open: true,
|
||||||
});
|
onfirst: (point) => { point.purgeOn = purgeOn }
|
||||||
|
});
|
||||||
|
}
|
||||||
layer.last().retract = true;
|
layer.last().retract = true;
|
||||||
// experimental post-retract wipe
|
// experimental post-retract wipe
|
||||||
start = print.polyPrintPath(box, start, layer, {
|
if (wipe) start = print.polyPrintPath(box, start, layer, {
|
||||||
tool,
|
tool,
|
||||||
rate,
|
rate,
|
||||||
simple: true,
|
simple: true,
|
||||||
open: false,
|
open: false,
|
||||||
extrude: 0
|
extrude: 0
|
||||||
});
|
});
|
||||||
|
layer.last().overate = 0;
|
||||||
start.purgeOff = purgeOn;
|
start.purgeOff = purgeOn;
|
||||||
return start;
|
return start;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -603,8 +611,10 @@
|
||||||
let mins = Infinity;
|
let mins = Infinity;
|
||||||
let miny = Infinity;
|
let miny = Infinity;
|
||||||
let pads = [];
|
let pads = [];
|
||||||
|
let overate = 0;
|
||||||
|
|
||||||
for (let rec of layer) {
|
for (let rec of layer) {
|
||||||
|
overate = rec.overate >= 0 ? rec.overate : overate;
|
||||||
let brate = params.firstLayerRate || firstLayerRate;
|
let brate = params.firstLayerRate || firstLayerRate;
|
||||||
let bmult = params.firstLayerPrintMult || firstLayerMult;
|
let bmult = params.firstLayerPrintMult || firstLayerMult;
|
||||||
let point = rec.point;
|
let point = rec.point;
|
||||||
|
|
@ -612,11 +622,11 @@
|
||||||
miny = Math.min(miny, belty);
|
miny = Math.min(miny, belty);
|
||||||
if (layer.anchor) {
|
if (layer.anchor) {
|
||||||
// apply base rate to entire anchor (including bump)
|
// apply base rate to entire anchor (including bump)
|
||||||
rec.speed = brate;
|
rec.speed = overate || brate;
|
||||||
}
|
}
|
||||||
if (rec.emit && belty <= thresh && lastout && Math.abs(lastout.belty - belty) < 0.005) {
|
if (rec.emit && belty <= thresh && lastout && Math.abs(lastout.belty - belty) < 0.005) {
|
||||||
// apply base speed to segments touching belt
|
// apply base speed to segments touching belt
|
||||||
rec.speed = brate;
|
rec.speed = overate || brate;
|
||||||
rec.emit *= bmult;
|
rec.emit *= bmult;
|
||||||
minx = Math.min(minx, point.x, lastout.point.x);
|
minx = Math.min(minx, point.x, lastout.point.x);
|
||||||
maxx = Math.max(maxx, point.x, lastout.point.x);
|
maxx = Math.max(maxx, point.x, lastout.point.x);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue