diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2015-12-18 20:36:39 +0300 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2015-12-18 20:36:39 +0300 |
commit | 8138fbf349a33adf35a61eccd931908d15dbdbf6 (patch) | |
tree | 7c7a39c75fc902063c32fd8f7eb63d8e3a4ffe0c /xs/src/libslic3r/GCodeWriter.cpp | |
parent | 562efc16771c7870edcd5ceac51081598a14726a (diff) |
New --retract-lift-above and --retract-lift-below options. #763 #3057
Diffstat (limited to 'xs/src/libslic3r/GCodeWriter.cpp')
-rw-r--r-- | xs/src/libslic3r/GCodeWriter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xs/src/libslic3r/GCodeWriter.cpp b/xs/src/libslic3r/GCodeWriter.cpp index e6bcb8df8..3ec301d70 100644 --- a/xs/src/libslic3r/GCodeWriter.cpp +++ b/xs/src/libslic3r/GCodeWriter.cpp @@ -495,7 +495,14 @@ GCodeWriter::unretract() std::string GCodeWriter::lift() { - double target_lift = this->config.retract_lift.get_at(0); + // check whether the above/below conditions are met + double target_lift = 0; + { + double above = this->config.retract_lift_above.get_at(0); + double below = this->config.retract_lift_below.get_at(0); + if (this->_pos.z >= above && this->_pos.z <= below && below > 0) + target_lift = this->config.retract_lift.get_at(0); + } if (this->_lifted == 0 && target_lift > 0) { this->_lifted = target_lift; return this->_travel_to_z(this->_pos.z + target_lift, "lift Z"); |