solve remaining object belt rotation and gcode generation issues
This commit is contained in:
parent
b3595ba8a2
commit
80e57335a1
5 changed files with 38 additions and 18 deletions
|
|
@ -182,20 +182,20 @@
|
|||
append(";; " + comment);
|
||||
}
|
||||
let o = [!rate && !newpos.e ? 'G0' : 'G1'];
|
||||
// put out x,y,z in belt mode if not engage/retract
|
||||
let xyz = newpos.x || newpos.y || newpos.z;
|
||||
let emit = { x: xyz && isBelt, y: xyz && isBelt, z: xyz && isBelt };
|
||||
if (typeof newpos.x === 'number') {
|
||||
let emit = { x: false, y: false, z: false };
|
||||
if (typeof newpos.x === 'number' && newpos.x !== pos.x) {
|
||||
pos.x = newpos.x;
|
||||
emit.x = true;
|
||||
}
|
||||
if (typeof newpos.y === 'number') {
|
||||
if (typeof newpos.y === 'number' && newpos.y !== pos.y) {
|
||||
pos.y = newpos.y;
|
||||
emit.y = true;
|
||||
if (isBelt) emit.z = true;
|
||||
}
|
||||
if (typeof newpos.z === 'number') {
|
||||
if (typeof newpos.z === 'number' && newpos.z !== pos.z) {
|
||||
pos.z = newpos.z;
|
||||
emit.z = true;
|
||||
if (isBelt) emit.y = true;
|
||||
}
|
||||
let epos = isBelt ? { x: pos.x, y: pos.y, z: pos.z } : pos;
|
||||
if (isBelt) {
|
||||
|
|
@ -249,11 +249,14 @@
|
|||
(process.firstSliceHeight || process.sliceHeight) : path.height);
|
||||
|
||||
subst.z = zpos = path.z;
|
||||
// subst.z = (zpos + path.height).toFixed(3);
|
||||
subst.Z = subst.z;
|
||||
subst.layer = layer;
|
||||
subst.height = path.height.toFixed(3);
|
||||
|
||||
if (isBelt) {
|
||||
pos.z = zpos;
|
||||
}
|
||||
|
||||
if (pauseCmd && pause.indexOf(layer) >= 0) {
|
||||
appendAllSub(pauseCmd)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,9 +292,9 @@
|
|||
let offset = widget.mesh ? Object.clone(widget.mesh.position) : {x:0, y:0, z:0};
|
||||
if (isBelt) {
|
||||
offset.x = widget.rotinfo.xpos;
|
||||
offset.y = widget.belt.miny;
|
||||
offset.y = -widget.belt.midy;
|
||||
offset.y += widget.rotinfo.ypos * beltfact;
|
||||
offset.z = widget.rotinfo.ypos * beltfact;
|
||||
offset.z = widget.rotinfo.ypos * beltfact;
|
||||
} else {
|
||||
// when rafts used this is non-zero
|
||||
offset.z = zoff;
|
||||
|
|
@ -385,23 +385,28 @@
|
|||
// alter settings for base extrusions (touching the bed)
|
||||
if (isBelt) {
|
||||
let widget = slice.widget;
|
||||
let lastout, minx = Infinity, maxx = -Infinity, first = false;
|
||||
let lastout, first = false;
|
||||
let minz = Infinity, maxy = -Infinity, minx = Infinity, maxx = -Infinity;
|
||||
let thresh = firstLayerHeight * 1.1;
|
||||
for (let out of tmpout) {
|
||||
let point = out.point;
|
||||
let belty = out.belty = -point.y + point.z * bfactor;
|
||||
if (out.emit && belty < firstLayerHeight && lastout && lastout.belty < firstLayerHeight) {
|
||||
if (out.emit && belty < thresh && lastout && lastout.belty < thresh) {
|
||||
out.speed = firstLayerRate;
|
||||
out.emit *= firstLayerMult;
|
||||
minx = Math.min(minx, point.x, lastout.point.x);
|
||||
maxx = Math.max(maxx, point.x, lastout.point.x);
|
||||
maxy = Math.max(maxy, point.y);
|
||||
minz = Math.min(minz, point.z);
|
||||
first = out;
|
||||
}
|
||||
lastout = out;
|
||||
}
|
||||
// add brim, if specified
|
||||
if (first && firstLayerBrim) {
|
||||
let {emit, tool, point} = first;
|
||||
let {x, y, z} = point;
|
||||
let {emit, tool } = first;
|
||||
let y = maxy;
|
||||
let z = minz;
|
||||
let b = Math.max(firstLayerBrim, 1);
|
||||
print.addOutput(tmpout, newPoint(minx - b, y, z), 0, firstLayerSeek, tool);
|
||||
print.addOutput(tmpout, newPoint(minx - 0, y, z), emit, firstLayerRate, tool);
|
||||
|
|
|
|||
|
|
@ -275,6 +275,7 @@
|
|||
bounds.merge(top.poly.bounds);
|
||||
}
|
||||
widget.belt.miny = -bounds.miny;
|
||||
widget.belt.midy = (bounds.miny + bounds.maxy) / 2;
|
||||
}
|
||||
|
||||
// report slicing complete
|
||||
|
|
|
|||
Loading…
Reference in a new issue