From 3568cd8497f90cf9710f9a80ba4f241ce487b4a7 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 19 Sep 2025 12:50:42 -0400 Subject: [PATCH] start passing back thin wall data to slice --- src/kiri/core/slice.js | 3 ++- src/kiri/mode/fdm/post.js | 28 ++++++++++++++-------------- src/kiri/mode/fdm/slice.js | 16 ++++++++++------ 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/kiri/core/slice.js b/src/kiri/core/slice.js index 934f7394..6982d2cf 100644 --- a/src/kiri/core/slice.js +++ b/src/kiri/core/slice.js @@ -144,7 +144,8 @@ class Slice { } else { // create top object from object bundle passed back by slicePost() let top = new Top(data.poly); - top.thin_fill = data.thin_fill ? data.thin_fill.map(p => newPoint(p.x,p.y,p.z)) : undefined; + top.thin_fill = data.thin_fill?.map(p => newPoint(p.x,p.y,p.z)); + top.thin_wall = data.thin_wall; top.fill_lines = data.fill_lines; top.fill_sparse = data.fill_sparse; top.fill_off = data.fill_off; diff --git a/src/kiri/mode/fdm/post.js b/src/kiri/mode/fdm/post.js index 80955d23..e26bbc4f 100644 --- a/src/kiri/mode/fdm/post.js +++ b/src/kiri/mode/fdm/post.js @@ -170,15 +170,14 @@ function thin_type_3(params) { let noodleWidth = offsetN * count; let { noodle, remain } = top.poly.noodle(noodleWidth); - // remaining area for infill after shells are extruded - let gaps = top.gaps = remain; - // render inset "noodle" // shells.appendAll(noodle); - let thin = top.thin_fill = []; - let shells = top.shells; - let sparse = top.fill_sparse = []; + let debugRemain = false; + let debugExtrusion = false; + + let shells = top.shells; // only used for debug + let trace = top.thin_wall = []; let midR = offsetN * 0.5; // nominal extrusion width let minR = midR * 0.75; // smallest interior fill or single wall width @@ -187,7 +186,6 @@ function thin_type_3(params) { let lines = []; let polys = []; - let trace = []; for (let i=0; i newPolygon().centerCircle(p, p.r, 12).setZ(slice.z)), vopt({ offset, height })); + + if (top.gaps?.length && devel) output .setLayer("gaps", Color.gaps) .addPolys(top.gaps, vopt({ offset, height, thin: true })); - if (isThin && devel && top.fill_off && top.fill_off.length) { + if (isThin && devel && top.fill_off?.length) { slice.output() .setLayer('fill inset', Color.inset) .addPolys(top.fill_off);