diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 3cd016b31e0..80d5263030a 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -5449,8 +5449,12 @@ std::string GCode::set_extruder(unsigned int extruder_id, double print_z) old_retract_length = m_config.retraction_length.get_at(previous_extruder_id); old_retract_length_toolchange = m_config.retract_length_toolchange.get_at(previous_extruder_id); old_filament_temp = this->on_first_layer()? m_config.nozzle_temperature_initial_layer.get_at(previous_extruder_id) : m_config.nozzle_temperature.get_at(previous_extruder_id); - wipe_volume = flush_matrix[previous_extruder_id * number_of_extruders + extruder_id]; - wipe_volume *= m_config.flush_multiplier; + if (m_config.purge_in_prime_tower) { + wipe_volume = flush_matrix[previous_extruder_id * number_of_extruders + extruder_id]; + wipe_volume *= m_config.flush_multiplier; + } else { + wipe_volume = m_config.prime_volume; + } old_filament_e_feedrate = (int)(60.0 * m_config.filament_max_volumetric_speed.get_at(previous_extruder_id) / filament_area); old_filament_e_feedrate = old_filament_e_feedrate == 0 ? 100 : old_filament_e_feedrate; //BBS: must clean m_start_gcode_filament diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index 2563db7bff2..95c28da2ab3 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -738,8 +738,16 @@ void ToolOrdering::reorder_extruders_for_minimum_flush_volume() const unsigned int number_of_extruders = (unsigned int) (sqrt(flush_matrix.size()) + EPSILON); // Extract purging volumes for each extruder pair: std::vector> wipe_volumes; - for (unsigned int i = 0; i < number_of_extruders; ++i) - wipe_volumes.push_back(std::vector(flush_matrix.begin() + i * number_of_extruders, flush_matrix.begin() + (i + 1) * number_of_extruders)); + if (m_print_config_ptr->purge_in_prime_tower) { + for (unsigned int i = 0; i < number_of_extruders; ++i) + wipe_volumes.push_back( + std::vector(flush_matrix.begin() + i * number_of_extruders, flush_matrix.begin() + (i + 1) * number_of_extruders)); + } else { + // populate wipe_volumes with prime_volume + for (unsigned int i = 0; i < number_of_extruders; ++i) { + wipe_volumes.push_back(std::vector(number_of_extruders, m_print_config_ptr->prime_volume)); + } + } unsigned int current_extruder_id = -1; for (int i = 0; i < m_layer_tools.size(); ++i) { diff --git a/src/libslic3r/GCode/WipeTower2.cpp b/src/libslic3r/GCode/WipeTower2.cpp index 3060d7bf5e6..8fc76935900 100644 --- a/src/libslic3r/GCode/WipeTower2.cpp +++ b/src/libslic3r/GCode/WipeTower2.cpp @@ -1021,7 +1021,6 @@ void WipeTower2::toolchange_Change( // This is where we want to place the custom gcodes. We will use placeholders for this. // These will be substituted by the actual gcodes when the gcode is generated. - writer.append("[filament_end_gcode]\n"); writer.append("[change_filament_gcode]\n"); // Travel to where we assume we are. Custom toolchange or some special T code handling (parking extruder etc) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 701ffa1cb4e..33cdcab5be2 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2464,7 +2464,7 @@ void Print::_make_wipe_tower() } this->throw_if_canceled(); - if (!m_config.purge_in_prime_tower) { + if (is_BBL_printer()) { // in BBL machine, wipe tower is only use to prime extruder. So just use a global wipe volume. WipeTower wipe_tower(m_config, m_plate_index, m_origin, m_config.prime_volume, m_wipe_tower_data.tool_ordering.first_extruder(), m_wipe_tower_data.tool_ordering.empty() ? 0.f : m_wipe_tower_data.tool_ordering.back().print_z); @@ -2588,17 +2588,20 @@ void Print::_make_wipe_tower() for (const auto extruder_id : layer_tools.extruders) { if (/*(first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || */ extruder_id != current_extruder_id) { - float volume_to_wipe = wipe_volumes[current_extruder_id][extruder_id]; // total volume to wipe after this toolchange - volume_to_wipe *= m_config.flush_multiplier; - // Not all of that can be used for infill purging: - volume_to_wipe -= (float) m_config.filament_minimal_purge_on_wipe_tower.get_at(extruder_id); - - // try to assign some infills/objects for the wiping: - volume_to_wipe = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, - volume_to_wipe); - - // add back the minimal amount toforce on the wipe tower: - volume_to_wipe += (float) m_config.filament_minimal_purge_on_wipe_tower.get_at(extruder_id); + float volume_to_wipe = m_config.prime_volume; + if (m_config.purge_in_prime_tower) { + volume_to_wipe = wipe_volumes[current_extruder_id][extruder_id]; // total volume to wipe after this toolchange + volume_to_wipe *= m_config.flush_multiplier; + // Not all of that can be used for infill purging: + volume_to_wipe -= (float) m_config.filament_minimal_purge_on_wipe_tower.get_at(extruder_id); + + // try to assign some infills/objects for the wiping: + volume_to_wipe = layer_tools.wiping_extrusions().mark_wiping_extrusions(*this, current_extruder_id, extruder_id, + volume_to_wipe); + + // add back the minimal amount toforce on the wipe tower: + volume_to_wipe += (float) m_config.filament_minimal_purge_on_wipe_tower.get_at(extruder_id); + } // request a toolchange at the wipe tower with at least volume_to_wipe purging amount wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height,