start adding threading to SLA

This commit is contained in:
Stewart Allen 2021-06-24 18:15:51 -04:00
commit 11225739e5
4 changed files with 36 additions and 18 deletions

View file

@ -1643,7 +1643,7 @@
detail: UC.newSelect(LANG.pt_qual_s, {title: LANG.pt_qual_l, action: detailSave}, "detail"),
decimate: UC.newBoolean(LANG.pt_deci_s, booleanSave, {title: LANG.pt_deci_l}),
healMesh: UC.newBoolean(LANG.pt_heal_s, booleanSave, {title: LANG.pt_heal_l}),
threaded: UC.newBoolean(LANG.pt_thrd_s, booleanSave, {title: LANG.pt_thrd_l, modes:FDM}),
threaded: UC.newBoolean(LANG.pt_thrd_s, booleanSave, {title: LANG.pt_thrd_l, modes:FDM_SLA}),
prefadd: UC.checkpoint($('prefs-add')),

View file

@ -54,8 +54,8 @@ KIRI.minions = {
union: function(polys, minarea) {
return new Promise((resolve, reject) => {
if (concurrent < 2 || polys.length * 2 < concurrent) {
resolve(POLY.union(polys, 0, true));
if (concurrent < 2 || polys.length < concurrent * 2 || POLY.points(polys) < concurrent * 50) {
resolve(POLY.union(polys, minarea, true));
return;
}
let polyper = Math.ceil(polys.length / concurrent);
@ -65,7 +65,7 @@ KIRI.minions = {
let polys = KIRI.codec.decode(data.union);
union.appendAll(polys);
if (--running === 0) {
resolve(POLY.union(union, 0, true));
resolve(POLY.union(union, minarea, true));
}
};
for (let i=0; i<polys.length; i += polyper) {