FIX: auto-arrange fails for multi-color objects

The cost for switching extruders was too big.

Change-Id: Ic9de6b6aabb7e69db79a0201f0dbb9d039097df9
This commit is contained in:
Arthur 2022-08-12 20:15:06 +08:00 committed by Lane.Wei
parent 06f878f13b
commit d95e85851c
4 changed files with 46 additions and 19 deletions

View file

@ -436,10 +436,12 @@ protected:
if (!params.allow_multi_materials_on_same_plate)
score += LARGE_COST_TO_REJECT * (item.extrude_id != p.extrude_id);
}
// for layered printing, we want extruder change as few as possible
// this has very weak effect, CAN NOT use a large weight
if (!params.is_seq_print) {
extruder_ids.insert(item.extrude_id);
score += 0.2 * LARGE_COST_TO_REJECT * std::max(0, ((int)extruder_ids.size() - 1));
score += 1 * std::max(0, ((int)extruder_ids.size() - 1));
}
return std::make_tuple(score, fullbb);