mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-02-22 04:22:20 -07:00
Enhance GCode handling for Z-axis movements (#10803)
* Enhance GCode handling for Z-axis movements - Updated `travel_to_z` method to include a `force` parameter, allowing forced Z movements. - Modified GCode generation logic to ensure Z position is restored after unknown last positions. - Enforce z restoreation after tool changer * Improve filament_multitool_ramming logic * fix indent
This commit is contained in:
parent
23ee1daac0
commit
b483dff617
5 changed files with 21 additions and 9 deletions
|
|
@ -633,12 +633,12 @@ std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &co
|
|||
return out_string;
|
||||
}
|
||||
|
||||
std::string GCodeWriter::travel_to_z(double z, const std::string &comment)
|
||||
std::string GCodeWriter::travel_to_z(double z, const std::string &comment, bool force)
|
||||
{
|
||||
/* If target Z is lower than current Z but higher than nominal Z
|
||||
we don't perform the move but we only adjust the nominal Z by
|
||||
reducing the lift amount that will be used for unlift. */
|
||||
if (!this->will_move_z(z)) {
|
||||
if (!force && !this->will_move_z(z)) {
|
||||
double nominal_z = m_pos(2) - m_lifted;
|
||||
m_lifted -= (z - nominal_z);
|
||||
if (std::abs(m_lifted) < EPSILON)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue