From 5765c2c6a28c4ded556339e81f6959c27b25d8db Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 25 Jan 2021 00:48:19 -0500 Subject: [PATCH] another sometimes-works case for multiple widgets --- notes.md | 9 +++------ src/kiri/worker.js | 11 ++++++++--- src/mode/fdm/prepare.js | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/notes.md b/notes.md index f342ca0a..d34578c8 100644 --- a/notes.md +++ b/notes.md @@ -2,6 +2,7 @@ ## `C` cosmetic, `F` functional, `P` performance, `B` bug fix +* `B` client/worker cache invalidated by latest rotation work * `B` saved profile should be restored / defaulted when switching devices? * `B` normals possibly inverted on faces in 2D to 3D conversion * `B` normalize left, bottom, right pop menu time/click and value persistence @@ -11,13 +12,12 @@ * `P` allow selection to me decimated on demand (context menu?) * `P` improve decimation speed: omit point conversion or use wasm * `P` client/worker interface normalization -* `P` explore widget vertex reloading / replacing +* `P` explore widget vertex reloading / replacing (Onshape primarily) * `F` SVG import to 3D part like images # FDM -* `B` client/worker cache invalidated by latest rotation work * `B` fix adaptive slicing with multi-extruder * `B` fix support projection/end with grouped parts * `B` multi-extruder rendering of raft fails to offset the rest of the print @@ -51,10 +51,7 @@ # FDM - BELT -* `B` when resize causes a part to move off-bed, move it back on -* `B` grouped widgets get placed off in space -* `B` layer retract broken? -* `B` infill / thin-fill is generating tons of small linear segments +* `B` multiple parts with one angled against origin "floats" in preview * `B` finish supports for belt printing. add progress. # CAM diff --git a/src/kiri/worker.js b/src/kiri/worker.js index 3fcf597e..89a8ce49 100644 --- a/src/kiri/worker.js +++ b/src/kiri/worker.js @@ -100,12 +100,16 @@ KIRI.worker = { return { miny, maxy }; } - for (let group of Object.values(wgroup)) { + function gmin(group) { let minv = {}; for (let w of group) { minv = mins(w.vertices, minv); } - let { miny, maxy } = minv; + return minv; + } + + for (let group of Object.values(wgroup)) { + let { miny, maxy } = gmin(group); let widget = group[0]; let track = widget.track; @@ -113,8 +117,9 @@ KIRI.worker = { let ypos = settings.device.bedDepth / 2 + track.pos.y + miny; let rotation = (Math.PI / 180) * 45; - widget.belt = { xpos, ypos }; widget.rotate(rotation,0,0,true); + let minr = gmin(group); + widget.belt = { xpos, ypos, yadd: minr.maxy - minr.miny }; for (let others of group.slice(1)) { others.belt = widget.belt; } diff --git a/src/mode/fdm/prepare.js b/src/mode/fdm/prepare.js index 2df8ac20..5cb7f2de 100644 --- a/src/mode/fdm/prepare.js +++ b/src/mode/fdm/prepare.js @@ -295,7 +295,7 @@ let o = rotinfo.ypos * beltfact; offset = { x: rotinfo.xpos, - y: o - belt.midy,// - belt.miny, + y: o - belt.midy - belt.yadd/2, z: o, }; // offset = { x:0, y:0, z:0 };