Ultimaker / Ultimaker/CuraEngine
Fluid Motion Smoothing Fails to Smooth in Some Cases
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 933
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
Application Version
Cura 5.5.0
Platform
Cura 5.5.0
Qt
Cura 5.5.0
PyQt
Cura 5.5.0
Display Driver
AMD Adrenalin Edition 23.11.1
Steps to Reproduce
- Turn on fluid motion with shift distance of 0.1, small distance of 0.05, and angle of 15.
- Slice a benchy.
- Print using a Klipper based printer.
Actual Results
There are still non-fluid motion segments remaining at the start of the bow curves that result in blobbing on the print. When I slice it there is one on layer 116 on the front right, identifiable by the gradient shading discontinuity:
Expected results
The current fluid motion smoothing will not process segments if the smooth distance is too large, leaving non-fluid segments. And if the smooth distance is set smaller so that the points are processed, then not all points are shifted enough as the shift amount is scaled by the smooth distance. This makes it practically impossible to set a smooth distance that will remove all non-fluid motions.
I believe the segment should be collapsed to single point, a different method of scaling the distance points are shifted, or some additional parameter added to handle this case.
Reading the smoothing source code the comment here indicates that if the outer segments are less than the shift distance the segment should be deleted: https://github.com/Ultimaker/CuraEngine/blob/0c3e9d0c492d15068f8afe9aa2743e5e068e7cbd/include/utils/actions/smooth.h#L79-L80
However, testing shows that the deletion of such line segments is never done. It looks like it should be done here but it is not:
https://github.com/Ultimaker/CuraEngine/blob/0c3e9d0c492d15068f8afe9aa2743e5e068e7cbd/include/utils/actions/smooth.h#L97-L103
Additional Information
Using a different G-Code viewer shows the segment in question and the coordinates around it (note that this g code was produced by Cura):
Note the super small line segment veering at almost a 45 degree angle towards the outside of the wall.
Here is a transcription of the a, b, c, d points from the g code that would be used by the smoothing algorithm:
a = Point(123.275, 97.555)
b = Point(122.311, 97.139)
c = Point(122.306, 97.122)
d = Point(121.33, 96.757)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with include/utils/actions/smooth.h, especially the linked sections around lines 79-80 and 97-103, and reproduce the issue using the listed smoothing settings on a benchy sliced for a Klipper-based printer. Inspect the generated G-code around the supplied points and verify that the remaining non-fluid segment is handled according to the smoothing behavior described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100