track xpos for belt widgets
This commit is contained in:
parent
9ce62bcac8
commit
d89674f1d5
2 changed files with 4 additions and 2 deletions
|
|
@ -66,6 +66,7 @@ KIRI.worker = {
|
|||
|
||||
let widget = cache[data.id],
|
||||
last = time(),
|
||||
xpos,
|
||||
ypos,
|
||||
now;
|
||||
|
||||
|
|
@ -74,6 +75,7 @@ KIRI.worker = {
|
|||
let rotation = (Math.PI/180) * (settings.device.bedBelt ? 45 : 0);
|
||||
if (rotation) {
|
||||
let track = widget.track;
|
||||
xpos = track.pos.x;
|
||||
ypos = track.pos.y + settings.device.bedDepth / 2 - track.box.h / 2;
|
||||
widget.mesh = null;
|
||||
widget.points = null;
|
||||
|
|
@ -106,7 +108,7 @@ KIRI.worker = {
|
|||
let wbb = widget.getBoundingBox(true);
|
||||
let dy = (wbb.max.y + wbb.min.y)/2;
|
||||
let dz = wbb.min.z;
|
||||
widget.rotinfo = { angle: 45, dy, dz, ypos };
|
||||
widget.rotinfo = { angle: 45, dy, dz, xpos, ypos };
|
||||
send.data({ rotinfo: widget.rotinfo });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,6 +301,7 @@
|
|||
let offset = Object.clone(mesh.position || center);
|
||||
if (isBelt) {
|
||||
offset = center;
|
||||
offset.x = widget.rotinfo.xpos;
|
||||
offset.y = widget.rotinfo.dz;
|
||||
offset.z = widget.rotinfo.ypos;
|
||||
} else {
|
||||
|
|
@ -363,7 +364,6 @@
|
|||
}
|
||||
layerout.height = layerout.height || closest.slice.height;
|
||||
slices[minidx] = null;
|
||||
// if (!isBelt) closest.offset.z = zoff;
|
||||
// detect extruder change and print purge block
|
||||
if (!lastOut || lastOut.extruder !== closest.slice.extruder) {
|
||||
printPoint = purge(closest.slice.extruder, track, layerout, printPoint, closest.slice.z);
|
||||
|
|
|
|||
Loading…
Reference in a new issue