improve outline routing by forcing inside then outside without size/dist weight hack. bump rev 2.8.D4

This commit is contained in:
Stewart Allen 2021-03-22 22:24:50 -04:00
commit 6e0c755a18
5 changed files with 8 additions and 7 deletions

View file

@ -56,7 +56,6 @@
# FDM - BELT # FDM - BELT
* `B` auto bed resizing leaves the origin in the wrong place at first * `B` auto bed resizing leaves the origin in the wrong place at first
* `B` ranges don't work with anchors
* `B` multiple parts with one angled against origin "floats" in preview * `B` multiple parts with one angled against origin "floats" in preview
* `B` re-add progress calls for all work units * `B` re-add progress calls for all work units

View file

@ -1,6 +1,6 @@
{ {
"name": "grid-apps", "name": "grid-apps",
"version": "2.8.3D", "version": "2.8.4D",
"description": "grid.space 3d slice & modeling tools", "description": "grid.space 3d slice & modeling tools",
"author": "Stewart Allen <sa@grid.space>", "author": "Stewart Allen <sa@grid.space>",
"license": "MIT", "license": "MIT",

View file

@ -6,7 +6,7 @@
if (!self.kiri) { if (!self.kiri) {
self.kiri = { self.kiri = {
beta: 2803, beta: 2804,
driver: {}, // driver modules driver: {}, // driver modules
loader: [] // module loading: array of functions loader: [] // module loading: array of functions
}; };

View file

@ -3,7 +3,7 @@
let terms = { let terms = {
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved", COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
LICENSE: "See the license.md file included with the source distribution", LICENSE: "See the license.md file included with the source distribution",
VERSION: "2.8.D3" VERSION: "2.8.D4"
}; };
if (typeof(module) === 'object') { if (typeof(module) === 'object') {

View file

@ -437,7 +437,7 @@
return start; return start;
} }
function depthOutlinePath(start, depth, levels, radius, emitter, clr, ease) { function depthOutlinePath(start, depth, levels, radius, emitter, dir, ease) {
let bottm = depth < levels.length - 1 ? levels[levels.length - 1] : null; let bottm = depth < levels.length - 1 ? levels[levels.length - 1] : null;
let above = levels[depth-1]; let above = levels[depth-1];
let level = levels[depth]; let level = levels[depth];
@ -462,6 +462,8 @@
// } // }
return true; return true;
}); });
// limit level search to polys matching winding (inside vs outside)
level = level.filter(p => p.isClockwise() === dir);
// omit polys that match bottom level polys unless level above is cleared // omit polys that match bottom level polys unless level above is cleared
start = poly2polyEmit(level, start, (poly, index, count, fromPoint) => { start = poly2polyEmit(level, start, (poly, index, count, fromPoint) => {
poly.level_emit = true; poly.level_emit = true;
@ -472,9 +474,9 @@
if (ease) { if (ease) {
fromPoint.z += ease; fromPoint.z += ease;
} }
fromPoint = depthOutlinePath(fromPoint, depth + 1, levels, radius, emitter, clr, ease); fromPoint = depthOutlinePath(fromPoint, depth + 1, levels, radius, emitter, dir, ease);
return fromPoint; return fromPoint;
}, {weight: true}); }, {weight: false});
return start; return start;
} }