diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index d7c346405..947cf8580 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -2624,11 +2624,11 @@ void WipeTower::get_wall_skip_points(const WipeTowerInfo &layer) } } -WipeTower::ToolChangeResult WipeTower::tool_change_new(size_t new_tool, bool solid_change) +WipeTower::ToolChangeResult WipeTower::tool_change_new(size_t new_tool, bool solid_toolchange,bool solid_nozzlechange) { m_nozzle_change_result.gcode.clear(); if (!m_filament_map.empty() && new_tool < m_filament_map.size() && m_filament_map[m_current_tool] != m_filament_map[new_tool]) { - m_nozzle_change_result = nozzle_change_new(m_current_tool, new_tool, solid_change); + m_nozzle_change_result = nozzle_change_new(m_current_tool, new_tool, solid_nozzlechange); } size_t old_tool = m_current_tool; @@ -2714,7 +2714,7 @@ WipeTower::ToolChangeResult WipeTower::tool_change_new(size_t new_tool, bool sol writer.travel(initial_position); } - toolchange_wipe_new(writer, cleaning_box, wipe_length, solid_change); + toolchange_wipe_new(writer, cleaning_box, wipe_length, solid_toolchange); writer.append(";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Wipe_Tower_End) + "\n"); ++m_num_tool_changes; @@ -2784,18 +2784,18 @@ WipeTower::NozzleChangeResult WipeTower::nozzle_change_new(int old_filament_id, WipeTowerBlock & block = get_block_by_category(m_filpar[old_filament_id].category); m_cur_block = █ + float dy = m_layer_info->extra_spacing * m_nozzle_change_perimeter_width; + if (has_tpu_filament() && m_extra_spacing < m_tpu_fixed_spacing) + dy = m_tpu_fixed_spacing * m_nozzle_change_perimeter_width; + box_coordinates cleaning_box(Vec2f(m_perimeter_width, block.cur_depth + (m_nozzle_change_perimeter_width - m_perimeter_width) / 2), - m_wipe_tower_width - 2 * m_perimeter_width, std::min(block.depth, m_wipe_tower_depth - block.cur_depth) - m_perimeter_width); + m_wipe_tower_width - 2 * m_perimeter_width, nozzle_change_line_count * dy); Vec2f initial_position = cleaning_box.ld; writer.set_initial_position(initial_position, m_wipe_tower_width, m_wipe_tower_depth, m_internal_rotation); - const float &xl = cleaning_box.ld.x(); - const float &xr = cleaning_box.rd.x(); - - float dy = m_layer_info->extra_spacing * m_nozzle_change_perimeter_width; - if (has_tpu_filament() && m_extra_spacing < m_tpu_fixed_spacing) - dy = m_tpu_fixed_spacing * m_nozzle_change_perimeter_width; + const float &xl = cleaning_box.ld.x(); + const float &xr = cleaning_box.rd.x(); dy = solid_infill ? m_nozzle_change_perimeter_width : dy; nozzle_change_line_count = solid_infill ? std::numeric_limits::max() : nozzle_change_line_count; m_left_to_right = true; @@ -3149,7 +3149,7 @@ WipeTower::ToolChangeResult WipeTower::finish_block(const WipeTowerBlock &block, return construct_block_tcr(writer, false, filament_id, true, 0.f); } -WipeTower::ToolChangeResult WipeTower::finish_block_solid(const WipeTowerBlock &block, int filament_id, bool extrude_fill) +WipeTower::ToolChangeResult WipeTower::finish_block_solid(const WipeTowerBlock &block, int filament_id, bool extrude_fill, bool interface_solid) { float layer_height = m_layer_height; float e_flow = m_extrusion_flow; @@ -3170,7 +3170,7 @@ WipeTower::ToolChangeResult WipeTower::finish_block_solid(const WipeTowerBlock & bool first_layer = is_first_layer(); // BBS: speed up perimeter speed to 90mm/s for non-first layer float feedrate = first_layer ? std::min(m_first_layer_speed * 60.f, 5400.f) : std::min(60.0f * m_filpar[filament_id].max_e_speed / m_extrusion_flow, 5400.f); - + feedrate = interface_solid ? 20.f * 60.f : feedrate; box_coordinates fill_box(Vec2f(0, 0), 0, 0); fill_box = box_coordinates(Vec2f(m_perimeter_width, block.cur_depth), m_wipe_tower_width - 2 * m_perimeter_width, block.start_depth + block.layer_depths[m_cur_layer_id] - block.cur_depth - m_perimeter_width); @@ -3801,7 +3801,11 @@ void WipeTower::generate_new(std::vector= block.start_depth + block.layer_depths[m_cur_layer_id]-m_perimeter_width) { continue; } - + int id = std::find_if(m_wipe_tower_blocks.begin(), m_wipe_tower_blocks.end(), [&](const WipeTowerBlock &b) { return &b == █ }) - m_wipe_tower_blocks.begin(); + bool interface_solid = solid_blocks_id.count(id); int finish_layer_filament = wall_idx; if (block.last_filament_change_id != -1) { finish_layer_filament = block.last_filament_change_id; @@ -3843,9 +3838,11 @@ void WipeTower::generate_new(std::vector