push part on z to accomodate anchor. match anchor width to brim, when set

This commit is contained in:
Stewart Allen 2021-04-13 09:57:56 -04:00
commit e92adbdb3d
2 changed files with 12 additions and 0 deletions

View file

@ -6,6 +6,7 @@ let BASE = self.base,
KIRI = self.kiri, KIRI = self.kiri,
UTIL = BASE.util, UTIL = BASE.util,
time = UTIL.time, time = UTIL.time,
qtpi = Math.cos(Math.PI/4),
current = self.worker = { current = self.worker = {
print: null, print: null,
snap: null snap: null
@ -122,6 +123,9 @@ KIRI.worker = {
let ypos = settings.device.bedDepth / 2 + track.pos.y + miny; let ypos = settings.device.bedDepth / 2 + track.pos.y + miny;
let rotation = (Math.PI / 180) * 45; let rotation = (Math.PI / 180) * 45;
// move to accomodate anchor
ypos += (settings.process.firstLayerBeltLead || 0) * qtpi;
widget.rotate(rotation,0,0,true); widget.rotate(rotation,0,0,true);
let minr = gmin(group); let minr = gmin(group);
widget.belt = { xpos, ypos, yadd: minr.maxy - minr.miny }; widget.belt = { xpos, ypos, yadd: minr.maxy - minr.miny };
@ -147,6 +151,8 @@ KIRI.worker = {
let { dy, dz } = widget.track.center; let { dy, dz } = widget.track.center;
widget.groupBounds(); widget.groupBounds();
let { xpos, ypos } = widget.belt; let { xpos, ypos } = widget.belt;
// move to accomodate anchor
dy -= (settings.process.firstLayerBeltLead || 0) * qtpi;
widget.rotinfo = { angle: 45, dy, dz, xpos, ypos }; widget.rotinfo = { angle: 45, dy, dz, xpos, ypos };
for (let others of group.slice(1)) { for (let others of group.slice(1)) {
others.rotinfo = widget.rotinfo; others.rotinfo = widget.rotinfo;

View file

@ -350,6 +350,12 @@
while (start.up && start.topShells().length === 0) { while (start.up && start.topShells().length === 0) {
start = start.up; start = start.up;
} }
// if a brim applies, add that width to anchor
let brim = spro.firstLayerBrim || 0;
if (brim) {
minx -= brim;
maxx += brim;
}
while (offset && start && offset >= sliceHeight) { while (offset && start && offset >= sliceHeight) {
let addto = start.down; let addto = start.down;
if (!addto) { if (!addto) {