From 17f87d58c49e85eff3ce8968c13ad16b03a40137 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 7 Mar 2018 10:08:30 -0500 Subject: [PATCH] more optimal adaptive in corner case. add heights to fixed slicing --- js/kiri-slicer.js | 7 +++++-- js/license.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/kiri-slicer.js b/js/kiri-slicer.js index b43df3af..f0a4d6bd 100644 --- a/js/kiri-slicer.js +++ b/js/kiri-slicer.js @@ -232,7 +232,8 @@ var gs_kiri_slicer = exports; zDivMax = Math.floor(zDelta / zInc); if (zDivMax && zDivMax < zDivMin) { - zStep = zDelta / (zDivMax + 1); + if (zDelta % zInc > 0.01) zDivMax++; + zStep = zDelta / zDivMax; } else { zStep = zDelta; } @@ -247,10 +248,12 @@ var gs_kiri_slicer = exports; // FDM fixed slicing if (options.firstHeight) { zIndexes.push(options.firstHeight / 2); + zHeights.push(options.firstHeight); zMin = options.firstHeight; } for (i = zMin + zOff; i < zMax; i += zInc) { zIndexes.push(i); + zHeights.push(zInc); } } @@ -419,7 +422,7 @@ var gs_kiri_slicer = exports; // allow empty slices in CAM swap mode (for topos w/ gaps) if (lines.length == 0 && !(options.swapX || options.swapY)) return; - slice.height = height || z; + slice.height = height; slice.index = slices.length; slice.lines = removeDuplicateLines(lines); diff --git a/js/license.js b/js/license.js index 5e3d8fbb..a1dd23be 100644 --- a/js/license.js +++ b/js/license.js @@ -1,7 +1,7 @@ var exports = { COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen - All Rights Reserved", LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.", - VERSION:"1.1.8b" + VERSION:"1.1.8c" }; if (!module) var module = {}; module.exports = exports;