diff --git a/notes.md b/notes.md index ed7643f3..a5565713 100644 --- a/notes.md +++ b/notes.md @@ -53,6 +53,7 @@ # FDM - BELT * `B` fix supports for belt printing +* `F` in slice mode, allow marking of repeat loop areas. add "loop" expert parameter # CAM diff --git a/package.json b/package.json index 5d6a4aca..75cf7284 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grid-apps", - "version": "2.6.6D", + "version": "2.6.7D", "description": "grid.space 3d slice & modeling tools", "author": "Stewart Allen ", "license": "MIT", diff --git a/src/kiri.js b/src/kiri.js index 2cbf0062..4c1145dc 100644 --- a/src/kiri.js +++ b/src/kiri.js @@ -6,7 +6,7 @@ if (!self.kiri) { self.kiri = { - beta: 2606, + beta: 2607, driver: {}, // driver modules loader: [] // module loading: array of functions }; diff --git a/src/kiri/print.js b/src/kiri/print.js index 2145cd8c..4e58e445 100644 --- a/src/kiri/print.js +++ b/src/kiri/print.js @@ -864,22 +864,21 @@ * to be more like outputOrderClosest() and have the option to account for * depth in determining distance */ - function poly2polyEmit(array, startPoint, emitter, options) { - let opt = options || {}; + function poly2polyEmit(array, startPoint, emitter, opt = {}) { let marker = opt.mark || 'delete'; let mindist, dist, found, count = 0; for (;;) { found = null; mindist = Infinity; - array.forEach(function(poly) { + for (let poly of array) { if (poly[marker]) { - return; + continue; } if (poly.isOpen()) { const d2f = startPoint.distTo2D(poly.first()); const d2l = startPoint.distTo2D(poly.last()); if (d2f > mindist && d2l > mindist) { - return; + continue; } if (d2l < mindist && d2l < d2f) { poly.reverse(); @@ -887,7 +886,7 @@ } else if (d2f < mindist) { found = {poly:poly, index:0, point:poly.first()}; } - return; + continue; } let area = poly.open ? 1 : poly.area(); poly.forEachPoint(function(point, index) { @@ -899,7 +898,7 @@ mindist = dist; } }); - }); + } if (!found || opt.term) { break; } @@ -908,7 +907,9 @@ } // undo delete marks - array.forEach(function(poly) { poly[marker] = false }); + if (opt.perm !== true) { + array.forEach(function(poly) { poly[marker] = false }); + } return startPoint; } diff --git a/src/license.js b/src/license.js index d77dcaaf..c3da23a4 100644 --- a/src/license.js +++ b/src/license.js @@ -3,7 +3,7 @@ let terms = { COPYRIGHT: "Copyright (C) Stewart Allen - All Rights Reserved", LICENSE: "See the license.md file included with the source distribution", - VERSION: "2.6.D6" + VERSION: "2.6.D7" }; if (typeof(module) === 'object') { diff --git a/src/mode/cam/ops.js b/src/mode/cam/ops.js index cde4e37c..177f7dcf 100644 --- a/src/mode/cam/ops.js +++ b/src/mode/cam/ops.js @@ -365,9 +365,14 @@ if (depthFirst) { let tops = depthData.map(level => { + // return POLY.nest(level.filter(poly => poly.depth === 0)); return POLY.nest(level.filter(poly => poly.depth === 0).clone()); }); printPoint = depthRoughPath(printPoint, 0, depthData, tops, polyEmit); + // printPoint = depthRoughPath(printPoint, 0, depthData, tops, (poly, index, count, start) => { + // console.log({z: poly.getZ(), i: poly.id, index, poly}); + // return polyEmit(poly, index, count, start); + // }); } setPrintPoint(printPoint); diff --git a/src/mode/cam/prepare.js b/src/mode/cam/prepare.js index efcd2857..ece67c60 100644 --- a/src/mode/cam/prepare.js +++ b/src/mode/cam/prepare.js @@ -424,7 +424,7 @@ fitted.filter(top => !top.level_emit).forEach(top => { top.level_emit = true; let inside = level.filter(poly => poly.isInside(top)); - start = poly2polyEmit(inside, start, emitter, { mark: "emark" }); + start = poly2polyEmit(inside, start, emitter, { mark: "emark", perm: true }); start = depthRoughPath(start, depth + 1, levels, tops, emitter, top); }); return start;