mark poly depth during fdm shelling
This commit is contained in:
parent
e3ad319292
commit
a92bb122a9
3 changed files with 17 additions and 11 deletions
|
|
@ -82,11 +82,11 @@ var gs_kiri_slice = exports;
|
|||
*/
|
||||
function Top(polygon) {
|
||||
this.poly = polygon; // outline poly
|
||||
this.traces = null; // array of offset/inset trace polygons
|
||||
this.inner = null; // array of inner fillable polygon areas (inside last trace)
|
||||
this.outer = null; // array of outer trace polygons
|
||||
this.fill_lines = null; // array of solid fill lines
|
||||
this.fill_sparse = null; // array of sparse fill polygons
|
||||
this.traces = null; // array of offset/inset trace polygons (ordered outer to inner)
|
||||
this.inner = null; // array of inner fillable areas (inset from last trace)
|
||||
this.outer = null; // array of outer trace polygons (TODO remove)
|
||||
this.fill_lines = null; // solid fill lines (array of points)
|
||||
this.fill_sparse = null; // sparse fill area open polygons (poly lines)
|
||||
this.solids = null; // solid fill regions in otherwise sparse fill (from solids.trimmed)
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ var gs_kiri_slice = exports;
|
|||
};
|
||||
|
||||
/**
|
||||
* Appends all top polygons into a given array and returns it
|
||||
* Returns all top polygons as an array
|
||||
*
|
||||
* @param {Polygon[]} out array to populate
|
||||
* @returns {Polygon[]} array of top polygons
|
||||
|
|
@ -375,13 +375,17 @@ var gs_kiri_slice = exports;
|
|||
last = [top.poly].clone(true);
|
||||
top.traces = last;
|
||||
} else {
|
||||
POLY.expand([top.poly], -offset1, top.poly.getZ(), top.traces, count, -offsetN, function(polys, count2) {
|
||||
if (count === count2) top.outer = polys;
|
||||
POLY.expand([top.poly], -offset1, top.poly.getZ(), top.traces, count, -offsetN, function(polys, countNow) {
|
||||
// first offset is the outer poly group (max count #)
|
||||
if (count === countNow) top.outer = polys;
|
||||
last = polys;
|
||||
// mark each poly with depth (offset #) starting at 0
|
||||
polys.forEach(function(p) { p.depth = count - countNow });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// generate fill offset poly set from last offset to top.inner
|
||||
if (fillOffset && last.length > 0) {
|
||||
last.forEach(function(inner) {
|
||||
POLY.trace2count(inner, top.inner, fillOffset, 1, 0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue