Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion Prusaslicer/Fuzzyficator_Prusaslicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,23 @@ def interpolate_with_constant_resolution(start_point, end_point, segment_length,
new_gcode.append(line)
elif line.startswith(';LAYER:'):
new_gcode.append(line)
elif 'G1' in line and 'Z' in line:

elif in_top_solid_infill and line.startswith('G1') and 'X' in line and 'Y' in line and not 'E' in line and not 'Z' in line:
logging.info("Processed a travel move")

coordinates = {param[0]: float(param[1:]) for param in line.split() if param[0] in 'XY'}
logging.debug(f"Extracted coordinates: {coordinates}")

current_point = (
coordinates.get('X', previous_point[0] if previous_point else 0),
coordinates.get('Y', previous_point[1] if previous_point else 0),
coordinates.get('Z', coordinates.get('Z', current_layer_height))
)
previous_point = current_point # Update previous point after travel move

new_gcode.append(line)

elif 'G1' in line and 'Z' in line and not 'X' in line:
# Update the current layer height based on the Z value in the G1 command
z_match = re.search(r'Z([-+]?[0-9]*\.?[0-9]+)', line)
if z_match:
Expand Down