From e92adbdb3de7d093b744cda37b81c0a874764df3 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 13 Apr 2021 09:57:56 -0400 Subject: [PATCH] push part on z to accomodate anchor. match anchor width to brim, when set --- src/kiri/worker.js | 6 ++++++ src/mode/fdm/slice.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/kiri/worker.js b/src/kiri/worker.js index 4d18136a..b2f38035 100644 --- a/src/kiri/worker.js +++ b/src/kiri/worker.js @@ -6,6 +6,7 @@ let BASE = self.base, KIRI = self.kiri, UTIL = BASE.util, time = UTIL.time, + qtpi = Math.cos(Math.PI/4), current = self.worker = { print: null, snap: null @@ -122,6 +123,9 @@ KIRI.worker = { let ypos = settings.device.bedDepth / 2 + track.pos.y + miny; let rotation = (Math.PI / 180) * 45; + // move to accomodate anchor + ypos += (settings.process.firstLayerBeltLead || 0) * qtpi; + widget.rotate(rotation,0,0,true); let minr = gmin(group); widget.belt = { xpos, ypos, yadd: minr.maxy - minr.miny }; @@ -147,6 +151,8 @@ KIRI.worker = { let { dy, dz } = widget.track.center; widget.groupBounds(); let { xpos, ypos } = widget.belt; + // move to accomodate anchor + dy -= (settings.process.firstLayerBeltLead || 0) * qtpi; widget.rotinfo = { angle: 45, dy, dz, xpos, ypos }; for (let others of group.slice(1)) { others.rotinfo = widget.rotinfo; diff --git a/src/mode/fdm/slice.js b/src/mode/fdm/slice.js index 85fa02f3..3d6cbf78 100644 --- a/src/mode/fdm/slice.js +++ b/src/mode/fdm/slice.js @@ -350,6 +350,12 @@ while (start.up && start.topShells().length === 0) { 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) { let addto = start.down; if (!addto) {