mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Get last position from previous layer instead.
Old code was next-next layer, which is actually the layer _after_ the one that is meant. Fixes #9430 CURA-8116
This commit is contained in:
parent
91fe9e8ebf
commit
2ed40fe2c6
1 changed files with 7 additions and 5 deletions
|
@ -338,11 +338,6 @@ class PauseAtHeight(Script):
|
|||
if current_layer < pause_layer - nbr_negative_layers:
|
||||
continue
|
||||
|
||||
# Get X and Y from the next layer (better position for
|
||||
# the nozzle)
|
||||
next_layer = data[index + 1]
|
||||
x, y = self.getNextXY(next_layer)
|
||||
|
||||
prev_layer = data[index - 1]
|
||||
prev_lines = prev_layer.split("\n")
|
||||
current_e = 0.
|
||||
|
@ -353,6 +348,13 @@ class PauseAtHeight(Script):
|
|||
current_e = self.getValue(prevLine, "E", -1)
|
||||
if current_e >= 0:
|
||||
break
|
||||
# and also find last X,Y
|
||||
for prevLine in reversed(prev_lines):
|
||||
if prevLine.startswith(("G0", "G1", "G2", "G3")):
|
||||
if self.getValue(prevLine, "X") is not None and self.getValue(prevLine, "Y") is not None:
|
||||
x = self.getValue(prevLine, "X")
|
||||
y = self.getValue(prevLine, "Y")
|
||||
break
|
||||
|
||||
# Maybe redo the last layer.
|
||||
if redo_layer:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue