half stab at remediating organic top diff triggering solid layers
This commit is contained in:
parent
b042a65373
commit
2353c33ef3
1 changed files with 4 additions and 2 deletions
|
|
@ -1354,6 +1354,7 @@ function doSolidsFill(slice, spacing, angle, minArea, fillQ) {
|
||||||
|
|
||||||
// parent each solid polygon inside the smallest bounding top
|
// parent each solid polygon inside the smallest bounding top
|
||||||
let make_solid_layer = false;
|
let make_solid_layer = false;
|
||||||
|
let tops_area = tops.map(top => top.poly.areaDeep()).reduce((a,i) => a+i);
|
||||||
for (let solid of solids) {
|
for (let solid of solids) {
|
||||||
for (let top of tops) {
|
for (let top of tops) {
|
||||||
let stop = [];
|
let stop = [];
|
||||||
|
|
@ -1369,12 +1370,13 @@ function doSolidsFill(slice, spacing, angle, minArea, fillQ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// problematic for organic shapes with lots of big and small tops
|
// problematic for organic shapes with lots of big and small tops
|
||||||
// the small tops tend to trigger entire layer fills
|
// the small tops tend to trigger entire layer fills. for now just
|
||||||
|
// trip full solid layer if a single top area diff > 50%
|
||||||
if (stop.length) {
|
if (stop.length) {
|
||||||
let top_area = top.poly.areaDeep();
|
let top_area = top.poly.areaDeep();
|
||||||
let stop_area = stop.map(p => p.areaDeep()).reduce((a,v) => a + v);
|
let stop_area = stop.map(p => p.areaDeep()).reduce((a,v) => a + v);
|
||||||
// if the solid area > 50% of the top area, make entire layer solid
|
// if the solid area > 50% of the top area, make entire layer solid
|
||||||
if (stop_area / top_area > 0.5) {
|
if (stop_area / tops_area > 0.5) {
|
||||||
make_solid_layer = true;
|
make_solid_layer = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue