fix: brim missing when mixed filament + painted brim + local-z whole objects are all enabled#466
Open
zackaree-shen wants to merge 1 commit into
Open
fix: brim missing when mixed filament + painted brim + local-z whole objects are all enabled#466zackaree-shen wants to merge 1 commit into
zackaree-shen wants to merge 1 commit into
Conversation
…objects are all enabled Root cause: When dithering_local_z_whole_objects=true, Local-Z phase-b routes all first-layer extrusions to pass_bucket.by_extruder, leaving the main by_extruder empty. The per-extruder loop then skips via continue, and the brim emission code inside the island loop never executes. Two fixes in GCode.cpp: 1. Emit brim before by_extruder.find() check, even when by_extruder is empty (handles the per-extruder empty case) 2. Emit brim before island loop, even when islands vector is empty (safety net for edge cases) Both are mutually exclusive via m_objsWithBrim.erase(). Also in Brim.cpp: skip extruder matching when brim type is btPainted, since firstLayerObjGroups() already handles extruder association internally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
@
Bug Description
When all three conditions are enabled simultaneously, the object brim is completely missing from the first layer gcode:
btPainted)dithering_local_z_whole_objects = true)Root Cause
In
GCode.cpp, whendithering_local_z_whole_objects = true, the Local-Z phase-b routing logic routes all first-layer extrusions topass_bucket.by_extruder. This leaves the mainby_extruderempty for the first layer.The per-extruder loop then hits
by_extruder.find(extruder_id) == end()→continue, skipping the entire loop body. The brim emission code originally lived inside the island loop within the per-extruder body, so it was never reached.Fix
GCode.cpp — Two mutually-exclusive brim emission points
Fix point 1 (per-extruder bypass): Before
by_extruder.find(), iteratem_objsWithBrimand emit brim even whenby_extruderis empty for this extruder.Fix point 2 (island bypass): Before the island loop, emit brim as a safety net even when the island vector is empty.
Both points are mutually exclusive via
m_objsWithBrim.erase().Brim.cpp — Extruder matching condition split
When
btPainted, skip the extruder matching check —firstLayerObjGroups()already handles extruder association internally.Files Changed
src/libslic3r/GCode.cppsrc/libslic3r/Brim.cppAnalysis Report
https://snapmaker.feishu.cn/wiki/C8D9wBU6YiPyPXkTaEPc3HZsnsg
@