mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-03 03:30:39 +08:00
Use proper z for no sparse layers travel start - this z is used to calculate lift of the travel (#12330, SPE-2176)
This commit is contained in:
parent
75fafd84f6
commit
3fdd02fff5
@ -3064,7 +3064,7 @@ void GCodeGenerator::GCodeOutputStream::write_format(const char* format, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
std::string GCodeGenerator::travel_to_first_position(const Vec3crd& point) {
|
||||
std::string GCodeGenerator::travel_to_first_position(const Vec3crd& point, const double from_z) {
|
||||
std::string gcode;
|
||||
|
||||
const Vec3d gcode_point = to_3d(this->point_to_gcode(point.head<2>()), unscaled(point.z()));
|
||||
@ -3082,7 +3082,7 @@ std::string GCodeGenerator::travel_to_first_position(const Vec3crd& point) {
|
||||
if (EXTRUDER_CONFIG(retract_length) > 0 && (!this->last_position || (!EXTRUDER_CONFIG(travel_ramping_lift)))) {
|
||||
if (!this->last_position || EXTRUDER_CONFIG(retract_before_travel) < (this->point_to_gcode(*this->last_position) - gcode_point.head<2>()).norm()) {
|
||||
gcode += this->writer().retract();
|
||||
gcode += this->writer().get_travel_to_z_gcode(gcode_point.z() + lift, "lift");
|
||||
gcode += this->writer().get_travel_to_z_gcode(from_z + lift, "lift");
|
||||
}
|
||||
}
|
||||
this->last_position = point.head<2>();
|
||||
@ -3121,7 +3121,7 @@ std::string GCodeGenerator::_extrude(
|
||||
|
||||
if (!m_current_layer_first_position) {
|
||||
const Vec3crd point = to_3d(path.front().point, scaled(this->m_last_layer_z));
|
||||
gcode += this->travel_to_first_position(point);
|
||||
gcode += this->travel_to_first_position(point, unscaled(point.z()));
|
||||
} else {
|
||||
// go to first point of extrusion path
|
||||
if (!this->last_position) {
|
||||
|
@ -334,7 +334,7 @@ private:
|
||||
const std::string &comment
|
||||
);
|
||||
|
||||
std::string travel_to_first_position(const Vec3crd& point);
|
||||
std::string travel_to_first_position(const Vec3crd& point, const double from_z);
|
||||
|
||||
bool needs_retraction(const Polyline &travel, ExtrusionRole role = ExtrusionRole::None);
|
||||
|
||||
|
@ -72,7 +72,7 @@ std::string WipeTowerIntegration::append_tcr(GCodeGenerator &gcodegen, const Wip
|
||||
}
|
||||
} else {
|
||||
const Vec3crd point = to_3d(xy_point, scaled(z));
|
||||
gcode += gcodegen.travel_to_first_position(point);
|
||||
gcode += gcodegen.travel_to_first_position(point, current_z);
|
||||
}
|
||||
gcode += gcodegen.unretract();
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user