From 1f249fb179dcdc5753e8a9e23203db07fae6171b Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 23 Jan 2023 18:49:47 -0500 Subject: [PATCH] fix missing some flats due to slicer z order refactor --- src/kiri-mode/cam/slicer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/kiri-mode/cam/slicer.js b/src/kiri-mode/cam/slicer.js index b8f4473d..5a4913a9 100644 --- a/src/kiri-mode/cam/slicer.js +++ b/src/kiri-mode/cam/slicer.js @@ -141,11 +141,10 @@ class Slicer { // sort Z and offset when on a flat const flatoff = util.numOrDefault(opt.flatoff, 0.01); - zs.sort().map(z => { - if (!opt.flatoff) { + zs = zs.sort((a,b) => a-b).map(z => { + if (!flatoff) { return z; } - // console.log({ bump_z: z, znomr, flatoff }); const znorm = z.toFixed(5); return this.zFlat[znorm] ? z + flatoff : z; });