fix sandwich mode for Arachene engine

This commit is contained in:
SoftFever 2022-12-16 23:07:05 +08:00
parent 52999ea757
commit 427f197ca9

View File

@ -1310,6 +1310,22 @@ void PerimeterGenerator::process_arachne()
}
}
if (this->print_config->wall_infill_order == WallInfillOrder::InnerOuterInnerInfill) {
if (ordered_extrusions.size() > 1) {
std::vector<int> extPs;
for (int i = 0; i < ordered_extrusions.size(); ++i) {
if (ordered_extrusions[i].extrusion->inset_idx == 0)
extPs.push_back(i);
}
for (int i = 0; i < extPs.size(); ++i) {
if (extPs[i] == 0 || (i > 0 && extPs[i] - 1 == extPs[i - 1]))
continue;
std::swap(ordered_extrusions[extPs[i]], ordered_extrusions[extPs[i] - 1]);
}
}
}
if (ExtrusionEntityCollection extrusion_coll = traverse_extrusions(*this, ordered_extrusions); !extrusion_coll.empty())
this->loops->append(extrusion_coll);