fix belt layout, diff with anchors
This commit is contained in:
parent
59c0db82cc
commit
703e63e08e
3 changed files with 28 additions and 32 deletions
|
|
@ -26,6 +26,7 @@
|
||||||
* `C` add parameterized control of bridge/flat and infill print speeds
|
* `C` add parameterized control of bridge/flat and infill print speeds
|
||||||
* `P` template vars: nozzles used and layers until next use (IDEX)
|
* `P` template vars: nozzles used and layers until next use (IDEX)
|
||||||
* `-` improved vertex replacement and widget update matrix tracking
|
* `-` improved vertex replacement and widget update matrix tracking
|
||||||
|
* `-` api control over (non) threaded workloads and wasm
|
||||||
|
|
||||||
## Mesh:Tool
|
## Mesh:Tool
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1064,7 +1064,7 @@ function doSparseLayerFill(slice, options = {}) {
|
||||||
*/
|
*/
|
||||||
function doDiff(slice, options = {}) {
|
function doDiff(slice, options = {}) {
|
||||||
const { sla, fakedown, grow, min } = options;
|
const { sla, fakedown, grow, min } = options;
|
||||||
if (slice.index === 0 && !fakedown) {
|
if (slice.index <= 0 && !fakedown) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const top = slice,
|
const top = slice,
|
||||||
|
|
|
||||||
|
|
@ -567,12 +567,34 @@ function platformLayout(event, gap) {
|
||||||
// space parts to account for anchor in belt mode
|
// space parts to account for anchor in belt mode
|
||||||
if (isBelt) {
|
if (isBelt) {
|
||||||
gap += process.firstLayerBeltLead || 0;
|
gap += process.firstLayerBeltLead || 0;
|
||||||
|
const WIDGETS = api.widgets.all();
|
||||||
|
let bounds = platformUpdateBounds(),
|
||||||
|
movey = -(device.bedDepth / 2);
|
||||||
|
for (let widget of WIDGETS) {
|
||||||
|
let ylen = widget.track.box.h;
|
||||||
|
// only move the root widget in the group
|
||||||
|
if (widget.id === widget.group.id) {
|
||||||
|
widget.move(0, movey + ylen/2, 0, true);
|
||||||
|
movey += ylen + gap;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let i, m, sz = isBelt ? {
|
if (controller.spaceLayout === 0) {
|
||||||
x: 1,
|
let sum = 0;
|
||||||
y: 100000
|
let sorted = WIDGETS.sort((a, b) => a.track.pos.y - b.track.pos.y);
|
||||||
} : space.platform.size(),
|
sorted.forEach(w => {
|
||||||
|
w.move(0, sum, 0);
|
||||||
|
sum += w.track.box.d + 1 + gap;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (controller.spaceRandoX) {
|
||||||
|
for (let w of WIDGETS) {
|
||||||
|
w.move(
|
||||||
|
(0.5 - Math.random()) * (device.bedWidth - w.track.box.w - process.firstLayerBrim),
|
||||||
|
0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let i, m, sz = space.platform.size(),
|
||||||
mp = [sz.x, sz.y],
|
mp = [sz.x, sz.y],
|
||||||
ms = [mp[0] / 2, mp[1] / 2],
|
ms = [mp[0] / 2, mp[1] / 2],
|
||||||
c = Widget.Groups.blocks().sort(moto.Sort),
|
c = Widget.Groups.blocks().sort(moto.Sort),
|
||||||
|
|
@ -589,33 +611,6 @@ function platformLayout(event, gap) {
|
||||||
m.fit.x += m.w / 2 + p.pad;
|
m.fit.x += m.w / 2 + p.pad;
|
||||||
m.fit.y += m.h / 2 + p.pad;
|
m.fit.y += m.h / 2 + p.pad;
|
||||||
m.move(p.max.w / 2 - m.fit.x, p.max.h / 2 - m.fit.y, 0, true);
|
m.move(p.max.w / 2 - m.fit.x, p.max.h / 2 - m.fit.y, 0, true);
|
||||||
// m.material.visible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isBelt) {
|
|
||||||
const WIDGETS = api.widgets.all();
|
|
||||||
let bounds = platformUpdateBounds(),
|
|
||||||
movey = -(device.bedDepth / 2 + bounds.min.y);
|
|
||||||
api.widgets.each(widget => {
|
|
||||||
// only move the root widget in the group
|
|
||||||
if (widget.id === widget.group.id) {
|
|
||||||
widget.move(0, movey, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (controller.spaceLayout === 0) {
|
|
||||||
let sum = 0;
|
|
||||||
let sorted = WIDGETS.sort((a, b) => a.track.pos.y - b.track.pos.y);
|
|
||||||
sorted.forEach(w => {
|
|
||||||
w.move(0, sum, 0);
|
|
||||||
sum += w.track.box.d + 1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (controller.spaceRandoX) {
|
|
||||||
for (let w of WIDGETS) {
|
|
||||||
w.move(
|
|
||||||
(0.5 - Math.random()) * (device.bedWidth - w.track.box.w - process.firstLayerBrim),
|
|
||||||
0, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue