Skip to content

Commit 9221dae

Browse files
Fixed bug where invalid gcode was generated when no wipes occured in the input gcode
1 parent 2bf92c6 commit 9221dae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bricklayers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ def wipe_movement(self, loop, target_state, simulator, feature, z = None):
11191119
gcodes.append(from_gcode(f"G1 Z{z:.2f} ; BRICK: Target Position\n"))
11201120
gcodes.append(from_gcode(f"G1 E{simulator.retraction_length:.2f} F{int(simulator.retraction_speed)} ; BRICK: Urnetract\n"))
11211121

1122-
else:
1122+
elif simulator.retraction_speed>0 and simulator.wipe_speed>0:
11231123
# wipe with travel:
11241124
gcodes.append(from_gcode(f"G1 E-{stopped_pull:.2f} F{int(simulator.retraction_speed)} ; BRICK: Retraction \n"))
11251125
gcodes.append(from_gcode(feature.const_wipe_start))
@@ -1131,7 +1131,11 @@ def wipe_movement(self, loop, target_state, simulator, feature, z = None):
11311131
if z is not None:
11321132
gcodes.append(from_gcode(f"G1 Z{z:.2f} ; BRICK: Target Position\n"))
11331133
gcodes.append(from_gcode(f"G1 E{simulator.retraction_length:.2f} F{int(simulator.retraction_speed)} ; BRICK: Urnetract\n"))
1134-
1134+
else:
1135+
# travel without wiping
1136+
gcodes.append(from_gcode(f"G1 X{target_state.x} Y{target_state.y}{hopping_z} F{int(simulator.travel_speed)} ; BRICK: Target Position\n"))
1137+
if z is not None:
1138+
gcodes.append(from_gcode(f"G1 Z{z:.2f} ; BRICK: Target Position\n"))
11351139
return gcodes
11361140

11371141

0 commit comments

Comments
 (0)