mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 21:15:52 +08:00
Fix wipe tower integration wiht regard to "no_sparse_layers".
Wipe tower with "no_sparse_layers" enabled was completely broken. This commit introduces necessary changes to WipeTowerIntegration.cpp for it to work properly.
This commit is contained in:
parent
353c9c2ea9
commit
91e79af261
@ -1021,8 +1021,6 @@ void WipeTower::toolchange_Change(
|
|||||||
+ " Y" + Slic3r::float_to_string_decimal_point(current_pos.y())
|
+ " Y" + Slic3r::float_to_string_decimal_point(current_pos.y())
|
||||||
+ never_skip_tag() + "\n"
|
+ never_skip_tag() + "\n"
|
||||||
);
|
);
|
||||||
writer.feedrate(m_travel_speed_z * 60.f)
|
|
||||||
.append("G1 Z" + Slic3r::float_to_string_decimal_point(this->m_z_pos) + "\n");
|
|
||||||
|
|
||||||
writer.append("[deretraction_from_wipe_tower_generator]");
|
writer.append("[deretraction_from_wipe_tower_generator]");
|
||||||
|
|
||||||
|
@ -82,7 +82,9 @@ std::string WipeTowerIntegration::append_tcr(GCodeGenerator &gcodegen, const Wip
|
|||||||
gcodegen.m_wipe.reset_path(); // We don't want wiping on the ramming lines.
|
gcodegen.m_wipe.reset_path(); // We don't want wiping on the ramming lines.
|
||||||
toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z); // TODO: toolchange_z vs print_z
|
toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z); // TODO: toolchange_z vs print_z
|
||||||
if (gcodegen.config().wipe_tower)
|
if (gcodegen.config().wipe_tower)
|
||||||
deretraction_str = gcodegen.unretract();
|
deretraction_str += gcodegen.writer().get_travel_to_z_gcode(z, "restore layer Z");
|
||||||
|
deretraction_str += gcodegen.unretract();
|
||||||
|
|
||||||
}
|
}
|
||||||
assert(toolchange_gcode_str.empty() || toolchange_gcode_str.back() == '\n');
|
assert(toolchange_gcode_str.empty() || toolchange_gcode_str.back() == '\n');
|
||||||
assert(deretraction_str.empty() || deretraction_str.back() == '\n');
|
assert(deretraction_str.empty() || deretraction_str.back() == '\n');
|
||||||
@ -150,18 +152,12 @@ std::string WipeTowerIntegration::post_process_wipe_tower_moves(const WipeTower:
|
|||||||
}
|
}
|
||||||
std::ostringstream line_out;
|
std::ostringstream line_out;
|
||||||
std::istringstream line_str(line);
|
std::istringstream line_str(line);
|
||||||
std::optional<float> z{};
|
|
||||||
line_str >> std::noskipws; // don't skip whitespace
|
line_str >> std::noskipws; // don't skip whitespace
|
||||||
char ch = 0;
|
char ch = 0;
|
||||||
line_str >> ch >> ch; // read the "G1"
|
line_str >> ch >> ch; // read the "G1"
|
||||||
while (line_str >> ch) {
|
while (line_str >> ch) {
|
||||||
if (ch == 'X' || ch == 'Y')
|
if (ch == 'X' || ch == 'Y')
|
||||||
line_str >> (ch == 'X' ? pos.x() : pos.y());
|
line_str >> (ch == 'X' ? pos.x() : pos.y());
|
||||||
else if (ch == 'Z') {
|
|
||||||
float z_value;
|
|
||||||
line_str >> z_value;
|
|
||||||
z = z_value;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
line_out << ch;
|
line_out << ch;
|
||||||
}
|
}
|
||||||
@ -177,8 +173,6 @@ std::string WipeTowerIntegration::post_process_wipe_tower_moves(const WipeTower:
|
|||||||
oss << " X" << transformed_pos.x() - extruder_offset.x();
|
oss << " X" << transformed_pos.x() - extruder_offset.x();
|
||||||
if (transformed_pos.y() != old_pos.y() || never_skip)
|
if (transformed_pos.y() != old_pos.y() || never_skip)
|
||||||
oss << " Y" << transformed_pos.y() - extruder_offset.y();
|
oss << " Y" << transformed_pos.y() - extruder_offset.y();
|
||||||
if (z)
|
|
||||||
oss << " Z" << *z;
|
|
||||||
if (! line.empty())
|
if (! line.empty())
|
||||||
oss << " ";
|
oss << " ";
|
||||||
line = oss.str() + line;
|
line = oss.str() + line;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user