SoftFever / OrcaSlicer

G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)
https://discord.gg/P4VE9UY9gJ
GNU Affero General Public License v3.0
6.61k stars 774 forks source link

Avoid crossing walls feature removes some retraction wipes #6266

Closed bernarden closed 2 weeks ago

bernarden commented 1 month ago

Is there an existing issue for this problem?

OrcaSlicer Version

2.1.1

Operating System (OS)

Windows

OS Version

Windows 11

Additional system information

No response

Printer

Creality Ender 5 S1

How to reproduce

  1. I used the following default profiles Creality Ender-5 S1 0.4 nozzle, Creality Generic PLA and 0.20mm Standard @Creality Ender5S1 but pretty sure it can be reproduced with other profiles.

  2. Generate Retraction test model (start: 0mm, end: 2mm, step: 0.1mm/mm).

  3. Change retraction wipe distance on printer setting to 10mm so it's very obvious when the bug occurs. image

  4. No overrides on filament level.

  5. Tick Avoid crossing walls

  6. Optionally set Max detour length to some value other than 0. (No impact changing this value)

  7. Slice the model and enable Travel line type in preview.

Actual results

On some layers one of the sides does not have a retraction wipe gcode generated. The results are very sporadic. When looking at any 10 layers at the time this issue could affect 0-2 lines but sometimes more like 7-8 lines. In any case this was leading to constant stringing no matter what retraction setting changes I did. 2024-07-27.webm

Also, you can observe on the side where the wipe gcode is generated the nozzle still crosses the walls anyway, but this perhaps is related more to #5217.

Expected results

Retraction wipe gcode is generated for both sides of the model.

Project file & Debug log uploads

Retraction test.zip

Checklist of files to include

Anything else?

I've tested a few previous versions to see if it ever worked and got the following results: 1.6.6 - works 1.8.1 - works 1.9.0 alpha - does not work 1.9.0 - does not work 1.9.1 - does not work 2.0.0 - does not work 2.1.1 - does not work

discip commented 1 month ago

Thank you figuring this out. 👍🏻

I was often wondering why some of my prints had the issue you described.

@vovodroid @igiannakas Could you please have a look?

vovodroid commented 1 month ago

Actually I don't use either of these options...

discip commented 3 weeks ago

@vovodroid This helps quite a bit when printing materials that are prone to stringing (e.g. PETG).

Any idea how Avoid crossing walls affects retraction wipes?
Avoid crossing walls disabled:

image
Avoid crossing walls enabled:

image

igiannakas commented 3 weeks ago

I think I may have fixed it but more testing is needed.

Basically there was a scenario where a retraction move when avoid crossing walls was performed but wipe was disabled in the code due to a number of conditions that are potentially incorrect.

With this change I'm forcing a wipe move whenever a retraction is performed and avoid crossing wall is enabled, in the same way to when avoid crossing wall is disabled.

image

PR will be raised shortly.

igiannakas commented 3 weeks ago

PR raised: https://github.com/SoftFever/OrcaSlicer/pull/6518

If you fancy, please give it a test.

igiannakas commented 3 weeks ago

The odd part is that this whole code segment plus all the code that executes the avoid crossing walls functionality is basically unchanged since the orca first fork. So seeing this behave differently between versions is unexplained but may need to be examined further.

I would expect the model shown above to show similar behaviour across all versions. It is a good test, if anyone fancies checking against 1.8.1.

bernarden commented 3 weeks ago

@igiannakas You are correct that the issue is present in 1.8.1. I haven't noticed it since only a few layers were missing the wipe operation. Since that version the issue kept getting worse though. 1 8 1-no-crossing 1 8 1-crossing 1 9 0-alpha-no-crossing 1 9 0-alpha-crossing 2 1 1-no-crossing 2 1 1-crossing

igiannakas commented 3 weeks ago

Hm this makes no sense as the immediate code has been unchanged - I even compared it against the curent prusa slicer code and it’s functionally identical 🤔

In any case the fix above should sort this once and for all as it enforces a wipe move when a retraction is being done, just like what the slicer does when avoid crossing walls is disabled.

I’d appreciate if you could test the build in the PR above and offer feedback please.