Fix broken hybrid tree trunks and localize support wall-count tooltip - #606
Open
mwz-iot wants to merge 3 commits into
Open
Fix broken hybrid tree trunks and localize support wall-count tooltip#606mwz-iot wants to merge 3 commits into
mwz-iot wants to merge 3 commits into
Conversation
…matching Bambu semantics Snapmaker external config uses 0=auto, but the tree support algorithm uses -1=auto internally. The 0 was being passed directly, causing the algorithm to treat 'auto' as 'explicit zero walls', leaving thin tree trunks without walls. Now 0 maps to -1 at the algorithm boundary, triggering Bambu's automatic wall count calculation. Also replaced geometry-based min_wall_count with Bambu's simple wall_count==0?0:1 logic.
…0=zero, 1/2=explicit)
zackaree-shen
approved these changes
Jul 23, 2026
lujiaxin001
approved these changes
Jul 23, 2026
bluetianyu
approved these changes
Jul 23, 2026
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.
Description
This PR fixes broken hybrid tree trunks when the support base pattern is set to:
It also aligns the
tree_support_wall_countconfiguration, initialization, runtime behavior, and localized tooltip descriptions with Bambu Studio.Root Cause
Snapmaker previously defined
tree_support_wall_countin the range[0, 2]and treated0as Auto.However, the tree-support algorithm uses the following semantics:
-1: automatic wall-count calculation0: explicitly generate zero perimeter walls and allow infill-only mode1: generate one perimeter wall2: generate two perimeter wallsBecause Snapmaker did not expose or initialize the actual automatic value
-1, the automatic wall-count logic was not triggered correctly.When the value was
0, the tree-support algorithm treated it as an explicit zero-wall setting. Thin tree trunks could therefore be generated without perimeter walls.For Rectilinear, Rectilinear Grid, and Honeycomb support patterns, the internal infill paths may not fully cover narrow trunk regions. Without perimeter walls, these regions appeared locally broken or missing in the sliced result.
The Snapmaker common process preset also explicitly set:
tree_support_wall_count = 2This overrode the configuration default and prevented the parameter from initializing with the same automatic value used by Bambu Studio.
In addition, after updating the tooltip text, some non-English interfaces did not have a corresponding translation entry. This caused the tooltip to display an incorrect language or fall back to the English source text.
Changes
Tree support wall-count behavior
Align
tree_support_wall_countsemantics with Bambu Studio:-1: Auto0: zero walls / infill-only mode1: one wall2: two wallsChange the configurable range from
[0, 2]to[-1, 2].Change the default value from
0to-1.Keep the maximum configurable wall count at
2.Update the Snapmaker common process preset to initialize
tree_support_wall_countto-1.Change the runtime wall-count variable from an unsigned type to
intso that-1is preserved correctly.Align the following tree-support behavior with Bambu Studio:
Ensure that extra-wall logic is triggered only when the configured value is
-1.Preserve explicit user settings:
0remains zero walls1remains one wall2remains two wallsTooltip localization
Keep the English tooltip text as the common source string in
PrintConfig.cpp.Add or update the corresponding translation entry in the supported language
.pofiles.Ensure that each supported UI language displays its own translated tooltip:
Prevent non-English interfaces from displaying the English tooltip because of a missing translation entry.
Preserve the Wiki URL without translating it.
Translate only the parameter explanation shown below the Wiki URL.
Keep the tooltip semantics consistent across all languages:
[-1, 2]-1: Auto0: zero walls / infill-only mode1: one wall2: two wallsRegenerate the compiled localization resources from the updated
.pofiles.Unchanged behavior
No changes were made to the Rectilinear fill algorithm.
No changes were made to the Rectilinear Grid fill algorithm.
No changes were made to the Honeycomb fill algorithm.
No changes were made to G-code preview rendering.
No language-specific
if/elselogic was added to the C++ source code.No new dependencies were introduced.
Compatibility
Older Snapmaker 3MF files may contain:
tree_support_wall_count = 0In older Snapmaker versions, this value was presented as Auto. Under the new unified semantics,
0means zero walls / infill-only mode.The existing 3MF metadata does not provide a reliable way to distinguish old projects from new projects. Therefore, this PR does not automatically migrate stored values from
0to-1.Users opening an older project may need to manually select
-1to restore automatic wall-count behavior.Screenshots / Recordings / Graphs
Rectilinear
Before
Hybrid tree trunks contain broken or missing sections.

After
Hybrid tree trunks remain complete when automatic wall-count calculation is enabled with tree_support_wall_count = -1.

Rectilinear Grid
Before
Hybrid tree trunks contain broken or missing sections.

After
Hybrid tree trunks remain complete when automatic wall-count calculation is enabled with tree_support_wall_count = -1.

Honeycomb
Before
Hybrid tree trunks contain broken or missing sections.

After
Hybrid tree trunks remain complete when automatic wall-count calculation is enabled with tree_support_wall_count = -1.

Localized tooltip
Simplified Chinese
The tree_support_wall_count tooltip is displayed in Simplified Chinese and correctly explains the [-1, 2] range.

English
The tooltip is displayed using the English source text.

Other supported languages
Each supported language displays its corresponding localized tooltip instead of the English source text.

Tests
Build
Configuration
[-1, 2].2.tree_support_wall_countto-1.-1.-1.-1.Tree support
tree_support_wall_count = -1.tree_support_wall_count = -1.tree_support_wall_count = -1.tree_support_wall_count = -1.0produces zero perimeter walls.1produces one perimeter wall.2produces two perimeter walls.Save and reload
-1.0.1and2are preserved after reopening the project.Localization
-1,0,1, and2semantics.