From 29dd305aaa4b738eaef91bd2de82e667a17d89fa Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Wed, 13 Jun 2018 11:48:43 +0200 Subject: [PATCH] Wiping into perimeters - bugfix (wrong order of perimeters and infills) --- xs/src/libslic3r/GCode.cpp | 17 ++++++++--------- xs/src/libslic3r/Print.cpp | 21 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index ce63a374c..809745da2 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -1249,13 +1249,13 @@ void GCode::process_layer( // We just added perimeter_coll->entities.size() entities, if they are not to be printed before the main object (during infill wiping), // we will note their indices (for each copy separately): - unsigned int last_added_entity_index = islands[i].by_region[region_id].perimeters.entities.size()-1; + unsigned int first_added_entity_index = islands[i].by_region[region_id].perimeters.entities.size() - perimeter_coll->entities.size(); for (unsigned copy_id = 0; copy_id < layer_to_print.object()->_shifted_copies.size(); ++copy_id) { if (islands[i].by_region[region_id].perimeters_per_copy_ids.size() < copy_id + 1) // if this copy isn't in the list yet islands[i].by_region[region_id].perimeters_per_copy_ids.push_back(std::vector()); if (!perimeter_coll->is_extruder_overridden(copy_id)) - for (int j=0; jentities.size(); ++j) - islands[i].by_region[region_id].perimeters_per_copy_ids[copy_id].push_back(last_added_entity_index - j); + for (int j=first_added_entity_index; jentities.size() entities, if they are not to be printed before the main object (during infill wiping), // we will note their indices (for each copy separately): - unsigned int last_added_entity_index = islands[i].by_region[region_id].infills.entities.size()-1; + unsigned int first_added_entity_index = islands[i].by_region[region_id].infills.entities.size() - fill->entities.size(); for (unsigned copy_id = 0; copy_id < layer_to_print.object()->_shifted_copies.size(); ++copy_id) { if (islands[i].by_region[region_id].infills_per_copy_ids.size() < copy_id + 1) // if this copy isn't in the list yet islands[i].by_region[region_id].infills_per_copy_ids.push_back(std::vector()); if (!fill->is_extruder_overridden(copy_id)) - for (int j=0; jentities.size(); ++j) - islands[i].by_region[region_id].infills_per_copy_ids[copy_id].push_back(last_added_entity_index - j); + for (int j=first_added_entity_index; j& GCode::ObjectByExtruder::Island::by_region_per_copy(unsigned int copy) { @@ -2522,10 +2523,8 @@ const std::vector& GCode::ObjectByExtru last_copy = copy; } - //std::vector out; for (const auto& reg : by_region) { by_region_per_copy_cache.push_back(ObjectByExtruder::Island::Region()); - //out.back().perimeters.append(reg.perimeters); // we will print all perimeters there are if (!reg.infills_per_copy_ids.empty()) for (unsigned int i=0; i