-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unretract before last travel move does not work #19236
Comments
Thanks for the report. |
I don't use the frontend but CuraEngine directly. Would you be happy with an stl file and command line? Or should I go file the bug on the CuraEngine repo? My past experience was that reports posted there tended to get overlooked. |
I print a lot and I know I don't have this problem but I always print Inside to Outside as I have experienced problems printing small holes when printing the outer wall first. |
On further investigation, unretracting on the inner wall has been fully broken since @jellespijker committed my fix. I can explain why the fix was wrong and must necessarily have broken it: |
OK, the fix in the above comment ( The |
@wawanbreton and/or @rburema can either of you take a look at this? |
Updated the title because it wasn't working anywhere. My above attempt at fixing isn't quite right so I'll follow up with more in a bit. |
I have a new theory on why Ultimaker/CuraEngine#1612 happened and why my fix (which introduced the current bug) was needed. The intent of the present code in CuraEngine was for I think the right fix is for I'll try to hack up a PoC for these changes and see if it works. |
PoC fix (against my tree, hopefully it doesn't have gratuitous conflicts):
I have not run extensive tests on this, but based on my dive into reading/understanding this code, I think the concept is very sound, and it produces correct output for basic smoke tests. |
Note: I forgot to remove the hard-coded 0.4 mm from testing. Obviously that should be fixed to match the move-inside logic elsewhere based on innermost line width. |
Hi @richfelker, thanks for the report. |
@wawanbreton I will when it's ready, but I think we should hold off a little. The above changes do the right thing in the cases I'm trying to address and most care about, but they have some potentially unwanted consequences like preventing the ability to do unretracted travel to the start of the next layer when the travel would take place entirely within a single part (and in practice is often very short). I think I'd like to break this into 2 or more parts. First, fixing the "unretract before last travel move" to work as it was originally intended for all travels except the connecting move between layers. This is a simple, self-contained fix and should be uncontroversial. Then, in order to allow the functionality to work at layer change, I want to introduce a better version of the above that chooses a point inside the comb boundary as the "first location of new layer", and emit an explicit move from there to the wall start that can have the "unretract before last travel move" flag set. Finally, I'm not convinced that the functionality I've been trying to fix is entirely a good thing. I've been carrying a patch to suppress it when there's only one wall, on account of this bug I reported: Ultimaker/CuraEngine#1704. However, I think in general that moving inside the "preferred comb boundary" is probably the wrong heuristic. Depending on a number of settings, the point selected can be significantly too far inside, possibly compromising seam integrity. Moreover, on prints in transparent material, the entire feature gives rather ugly zits visible inside the seam that accentuate it rather than concealing it as intended. What I'd like to do is make it the whole feature optional, either with an on/off setting or a configurable distance inward from the outer perimeter (rather than from preferred comb boundary) whose default could be zero if there's only one perimeter, and otherwise the outer wall line width. I know there's a hesitance to add too many unnecessary switches, but this seems like a place where there are compelling reasons to prefer either behavior depending on material, priority of air/water-tightness requirements vs dimensional accuracy requirements of the part, etc. |
FWIW there's another issue I have open (and for which I'm carrying a local patch) related to this functionality: Ultimaker/CuraEngine#1712. It'd be nice to get that fixed too. |
This in indeed what we do when we have features for which we are not really sure they will make everyone happy. It probably doesn't help for advertising them, but at least when someone is in need, we can say "just enable this" ! Take your time, I don't have the feeling that this issue is highly harmful. I mean, it may impact overall quality, but won't fail the print :) |
Sure. The main thing that seems actively harmful to print quality with the current upstream code (which, per my old patch that got adopted, completely suppresses the early unretract) is that the travel route on inward sloping parts will often gratuitously travel through a point outside the perimeter, where, depending on acceleration and z-hop settings, it may be more likely to deposit zits than a direct travel move to the desired starting position on the perimeter would do. Otherwise, fixing this is mostly about getting the intended benefits of the unretract-inside improvement my patch unintentionally suppressed. I've been experimenting a little bit more, and ran into my above approach causing a sort of "double Z hop" at layer change if Z-hop is enabled: doing a Z-hop, travelling to the destination, then hopping again and only descending on the final exrusion start point. This greatly increases zits/surface defects. I've now been able to get it not to do that, but I'm not sure the logic follows the intend of the existing code, so I will post it for review at some point once I'm confident it's at least producing good output. |
Thanks for you effort. If you want to, you can also have a look at this PR: Ultimaker/CuraEngine#2075 It is currently in an early experimental state, but in the coming weeks we will have to implement it properly, which means touching a lot of code related to travel moves, retraction and unrectration, and Z-hop. I just hope we don't work in parrallel and end up with conflicting changes on both sides. And if I understand correctly, having this feature work properly would make your changes obsolete. So maybe just wait for it to be done, and make a review on your side once we are ready ? |
@wawanbreton Thanks for the reference. If there are people working on this already, I don't want to step on their toes. I'll keep and continue using my changes against 5.7 and report any important observations. I don't see any way my code changes will be directly useful to the upstream work moving forward, but what I would like to happen is:
From what I skimmed of the PR so far, though, it looks like they're aware of some of the same things I've been fighting with, so I think this is all moving in a good direction! |
I must admit I didn't get deep into your patch yet, but I will add this as a prerequisite to working on the topic.
Well you can read the code as we regularly push it, but I will try to remember to send you a notification when the code is in a more stable state. It is very likely that I will be working on this, so it should help 😃
Good to know, thanks for taking the time to look at it ! |
Cura Version
5.7.0
Operating System
Any
Printer
Any
Reproduction steps
Slice a file/job with multiple disconnected parts and outer perimeters first, no infill or infill-after-perimeters, such that the first move of a layer is a travel to an outer perimeter.
Actual results
The travel move to the start of a new layer will unretract on the outer perimeter rather than on an inner one.
This happens as a consequence of my naive fix for Ultimaker/CuraEngine#1612 but without that fix, much worse things happen (the entire travel to the start of the new layer takes place unretracted!)
I don't understand this part of the code entirely but it looks like there is some merging of the path at the end of one layer and beginning of the next which breaks the logic.
Expected results
Unretract should take place on the inner perimeter before the final travel move to the outer perimeter.
The text was updated successfully, but these errors were encountered: