mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-25 08:58:35 -07:00
Merge pull request #20999 from GregValiant/ZHopOnTravelUpdate
Update ZHopOnTravel.py
This commit is contained in:
parent
aeb8ee3991
commit
bb02afef29
1 changed files with 3 additions and 3 deletions
|
|
@ -316,7 +316,7 @@ class ZHopOnTravel(Script):
|
|||
if hop_start > 0:
|
||||
# For any lines that are XYZ moves right before layer change
|
||||
if " Z" in line:
|
||||
lines[index] = lines[index].replace("Z" + str(self._cur_z), "Z" + str(self._cur_z + hop_height))
|
||||
lines[index] = lines[index].replace(f"Z{self._cur_z}", f"Z{round(self._cur_z + hop_height, 3)}")
|
||||
# If there is no 'F' in the next line then add one at the Travel Speed so the z-hop speed doesn't carry over
|
||||
if not " F" in lines[index] and lines[index].startswith("G0"):
|
||||
lines[index] = lines[index].replace("G0", f"G0 F{speed_travel}")
|
||||
|
|
@ -421,9 +421,9 @@ class ZHopOnTravel(Script):
|
|||
|
||||
machine_height = Application.getInstance().getGlobalContainerStack().getProperty("machine_height", "value")
|
||||
if self._cur_z + hop_height < machine_height:
|
||||
up_lines = f"G1 F{speed_zhop} Z{round(self._cur_z + hop_height,2)} ; Hop Up"
|
||||
up_lines = f"G1 F{speed_zhop} Z{round(self._cur_z + hop_height, 3)} ; Hop Up"
|
||||
else:
|
||||
up_lines = f"G1 F{speed_zhop} Z{round(machine_height, 2)} ; Hop Up"
|
||||
up_lines = f"G1 F{speed_zhop} Z{round(machine_height, 3)} ; Hop Up"
|
||||
if reset_type in [1, 9] and hop_retraction: # add retract only when necessary
|
||||
up_lines = f"G1 F{retract_speed} E{round(self._cur_e - retraction_amount, 5)} ; Retract\n" + up_lines
|
||||
self._cur_e = round(self._cur_e - retraction_amount, 5)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue