Skip to content

Cura 13073#2338

Open
HellAholic wants to merge 23 commits into
mainfrom
CURA-13073
Open

Cura 13073#2338
HellAholic wants to merge 23 commits into
mainfrom
CURA-13073

Conversation

@HellAholic

@HellAholic HellAholic commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This pull request refactors and enhances the logic for generating support brims in the generateSupportBrim() function in src/SkirtBrim.cpp. The main improvements include supporting both inside and outside brim locations, introducing a shared brim generation loop, and improving the exclusion of areas for brim placement.

Support brim generation improvements:

  • Added support for generating support brims both inside and outside the support outline, controlled by the support_brim_location setting. The brim generation logic now checks the location and applies the appropriate offset direction and exclusion area.
  • Refactored the brim generation code into a reusable lambda (generate_brim_loop), which handles both inward (inside) and outward (outside) brim offsets, improving code clarity and maintainability.
  • For outside brims, added logic to exclude areas already covered by the model's brim and ensure a gap from the model by offsetting exclusion areas, preventing unwanted overlap.
  • Improved dynamic adjustment of the number of brim lines to ensure the total brim length meets the minimum requirement, regardless of brim location.

Bug fixes and minor corrections:

  • Fixed a typo in a comment ("the fist layer" → "the first layer") and improved some comments for clarity.

Comes with: Ultimaker/Cura#21660

CURA-13073

HellAholic and others added 9 commits April 2, 2026 11:11
Refactor support brim generation to respect BrimLocation and handle inward/outward rings separately. Renamed line_count to base_line_count and added location check; inside brims now create a brim area that is excluded from support infill, while outside brims skip rings that overlap existing build-plate adhesion brim coverage to avoid double-printing. Kept hole-removal and dynamic line_count growth when total brim length is below minimal_length; pushed individual brim rings into storage_.support_brim. Overall this avoids duplicate extrusion and clarifies brim generation flow.
Prevent support brim rings from printing into model geometry by collecting model-only outlines at layer 0 (excluding supports/prime tower) and offsetting them by half the brim line width. The generated brim rings are then clipped (difference) against this collision mask before hole removal. Adds explanatory comments and uses jtRound when offsetting outlines.
When computing existing brim coverage for outside support brim rings, iterate over every extruder instead of only the support infill extruder. This unions offset skirt/brim lines from all extruders (adhesion brim, skirt, shield, etc.) so support brim rings are clipped against any already-generated paths and won't print on top of them.

Revert "Account for all extruders in brim coverage"

This reverts commit 211b59b.
Support could have a different extruder from the model, if we only get the outline of the support extruder we only check for collisions with models printed with the support extruder
Increase the margin between the support brim and the model.
Rather than skipping the entire brim line when there is a collision, only skip the collision

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates support-brim generation to respect a new support_brim_location setting (inside/outside), including logic to avoid overlapping the existing skirt/brim and to prevent collisions with the model when generating an outside support brim.

Changes:

  • Add support_brim_location handling to generate support brim inside and/or outside the support outline.
  • When generating outside support brim, subtract existing skirt/brim coverage and model collision areas.
  • Refactor support-brim line generation into separate inside/outside branches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/SkirtBrim.cpp Outdated
Comment thread src/SkirtBrim.cpp Outdated
Comment thread src/SkirtBrim.cpp Outdated
Comment thread src/SkirtBrim.cpp Outdated
Comment thread src/SkirtBrim.cpp Outdated
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Test Results

31 tests   31 ✅  5s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 804feb5.

♻️ This comment has been updated with latest results.

HellAholic and others added 9 commits June 16, 2026 10:51
support_brim_line_count should suffice as the reference for the generation of the support brim, this removes the inter-dependency and simplifies the calculations.

In addition for detecting collision with the build plate adhesion skirt, we need to shift the calculation to detect the inner most boundary of skirt rather than outer most.
Skirt is printed with all extruders, so only accounting for the support_infill_extruder's skirt was an oversight.
Remove the variable and description copied over from the skirt_brim generation for the model.
calling the support generation first simplifies the process and makes the process easier to predict.
We first generate the support brim, then call the skirt_brim.generate() after that.
@HellAholic HellAholic marked this pull request as ready for review June 17, 2026 09:14
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.

2 participants