You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
// Smooth the path, by moving over three segments at a time. If the middle segment is shorter than the max resolution, then we try shifting those points outwards.
// The previous and next segment should have a remaining length of at least the smooth distance, otherwise the point is not shifted, but deleted.
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:
// only if segments ab and cd are long enough, we can shift b and c
// 3 * fluid_motion_shift_distance is the minimum length of the segments ab and cd
// as this allows us to shift both ends with the shift distance and still have some room to spare
if (magnitude_ab < fluid_motion_shift_distance3 || magnitude_cd < fluid_motion_shift_distance3)
{
continue;
}
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)
The text was updated successfully, but these errors were encountered:
mfish38
changed the title
Fluid Motion Smoothing Bug
Fluid Motion Smoothing Fails to Smooth in Some Cases
Nov 14, 2023
My guess is that this has the potential to occur whenever shift distance is greater than 1/3 of the maximum resolution slicer setting. At a minimum, perhaps adding fluid_motion_shift_distance = min(<max resolution> / 3.0 - epsilon, fluid_motion_shift_distance) would prevent large shift distances from unexpectedly resulting in suddenly having unsmoothed segments.
Then perhaps some setting or toggle to optionally collapse segments that fail the 3x shift distance check to a point instead of limiting the shift distance.
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
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:
CuraEngine/include/utils/actions/smooth.h
Lines 79 to 80 in 0c3e9d0
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:
CuraEngine/include/utils/actions/smooth.h
Lines 97 to 103 in 0c3e9d0
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)
The text was updated successfully, but these errors were encountered: