PP-521: Fix resolve logic for adhesion_type #19632
Merged
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.
PP-512 Fix resolve logic for
adhesion_type
Pick the most "sticky" option of all the enabled extruders for
adhesion_type
Problem
Currently, the resolve function for adhesion_type is extruderValue(adhesion_extruder_nr, 'adhesion_type'). But when using dual extrusion, Cura makes the brim from multiple materials, depending on what material that piece of brim touches.
For example with (1) PVA and (2) PPS-CF on a Factor 4, the current logic is that the global adhesion_extruder_nr defaults to 1 (left), and so it uses the adhesion_type value of the PVA, which doesn’t have any set, so defaults to the global skirt, even though the PPS-CF wants brim.
Solution
Make the resolve of adhesion_type a function that picks the first option from the list ['raft', 'brim', 'skirt', 'none'] that any of the used extruders selects.
"resolve": "min(extruderValues('adhesion_type'), key=lambda v: ('raft', 'brim', 'skirt', 'none').index(v))"
In this screenshot, left is the current/old profile, and right is with the new resolve function where Cura correctly picks up the brim preference of the PPS-CF.