Skip to content
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

PP-521: Fix resolve logic for adhesion_type #19632

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

Frederic98
Copy link
Contributor

@Frederic98 Frederic98 commented Sep 9, 2024

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.

Copy link
Contributor

@wawanbreton wawanbreton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is really smart 👍

@HellAholic HellAholic merged commit 96abc03 into main Oct 7, 2024
12 checks passed
@HellAholic HellAholic deleted the PP-521_Fix_adhesion-type_resolve-logic branch October 7, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants