diff options
Diffstat (limited to 'xs/src/libslic3r/GCode.cpp')
-rw-r--r-- | xs/src/libslic3r/GCode.cpp | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 3536c0c9c..0ccc4384e 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -1338,26 +1338,31 @@ void GCode::process_layer( m_avoid_crossing_perimeters.disable_once = true; } - for (const auto& layer_to_print : layers) { // iterate through all objects - if (layer_to_print.object_layer == nullptr) - continue; - std::vector<ObjectByExtruder::Island::Region> overridden; - for (size_t region_id = 0; region_id < print.regions.size(); ++ region_id) { - ObjectByExtruder::Island::Region new_region; - overridden.push_back(new_region); - for (ExtrusionEntity *ee : (*layer_to_print.object_layer).regions[region_id]->fills.entities) { - auto *fill = dynamic_cast<ExtrusionEntityCollection*>(ee); - if (fill->get_extruder_override() == extruder_id) { - overridden.back().infills.append(*fill); - fill->set_extruder_override(-1); - } - } - m_config.apply((layer_to_print.object_layer)->object()->config, true); - Point copy = (layer_to_print.object_layer)->object()->_shifted_copies.front(); - this->set_origin(unscale(copy.x), unscale(copy.y)); - gcode += this->extrude_infill(print, overridden); + gcode += "; INFILL WIPING STARTS\n"; + + if (extruder_id != layer_tools.extruders.front()) { // if this is the first extruder on this layer, there was no toolchange + for (const auto& layer_to_print : layers) { // iterate through all objects + if (layer_to_print.object_layer == nullptr) + continue; + std::vector<ObjectByExtruder::Island::Region> overridden; + for (size_t region_id = 0; region_id < print.regions.size(); ++ region_id) { + ObjectByExtruder::Island::Region new_region; + overridden.push_back(new_region); + for (ExtrusionEntity *ee : (*layer_to_print.object_layer).regions[region_id]->fills.entities) { + auto *fill = dynamic_cast<ExtrusionEntityCollection*>(ee); + if (fill->get_extruder_override() == extruder_id) { + overridden.back().infills.append(*fill); + fill->set_extruder_override(-1); + } + } + m_config.apply((layer_to_print.object_layer)->object()->config, true); + Point copy = (layer_to_print.object_layer)->object()->_shifted_copies.front(); + this->set_origin(unscale(copy.x), unscale(copy.y)); + gcode += this->extrude_infill(print, overridden); + } } } + gcode += "; WIPING FINISHED\n"; auto objects_by_extruder_it = by_extruder.find(extruder_id); |