Fix small area infill flow compensation (graph version) causing some lines to not extrude (#4374) #4399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello 3D printing crew
I found the issue that the user was presenting in #4374. The problem was that the actual graph points data structure and
begin_idx
,end_idx
usage were inconsistent in this function. As a result, all extrusion lengths above the max value we account for in the graph (~3.0mm in our case) were not interpolated and got a multiplication factor of 0 instead (the default in this function). I am not sure why the graph implementation works as it does but these changes make this function comply with how the graph and its data structures are currently implemented.Below is the user's scenario as an example, working as expected.
Additional fixes:
y_value
to 1.0f, so the default behaviour leaves the extrusion value as it was.(I): This can cause some discrepancies if we have 2 lines with very close but not equal lengths, as they will both get assigned the same extrusion factor. We could remove this check or make it compare from the left side only, but then again it is a small performance optimization. I leave this decision to the owner :)
(II): A question on the feature; should the feature's function not be monotonically non-decreasing? I personally cannot think of a case where a shorter line should extrude more than a longer one.