Skip to content

Fix broken hybrid tree trunks and localize support wall-count tooltip - #606

Open
mwz-iot wants to merge 3 commits into
process_optimistic_julyfrom
fix/tree_support_wall_count_i18n
Open

Fix broken hybrid tree trunks and localize support wall-count tooltip#606
mwz-iot wants to merge 3 commits into
process_optimistic_julyfrom
fix/tree_support_wall_count_i18n

Conversation

@mwz-iot

@mwz-iot mwz-iot commented Jul 23, 2026

Copy link
Copy Markdown

Description

This PR fixes broken hybrid tree trunks when the support base pattern is set to:

  • Rectilinear
  • Rectilinear Grid
  • Honeycomb

It also aligns the tree_support_wall_count configuration, initialization, runtime behavior, and localized tooltip descriptions with Bambu Studio.

Root Cause

Snapmaker previously defined tree_support_wall_count in the range [0, 2] and treated 0 as Auto.

However, the tree-support algorithm uses the following semantics:

  • -1: automatic wall-count calculation
  • 0: explicitly generate zero perimeter walls and allow infill-only mode
  • 1: generate one perimeter wall
  • 2: generate two perimeter walls

Because 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 = 2

This 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_count semantics with Bambu Studio:

    • -1: Auto
    • 0: zero walls / infill-only mode
    • 1: one wall
    • 2: two walls
  • Change the configurable range from [0, 2] to [-1, 2].

  • Change the default value from 0 to -1.

  • Keep the maximum configurable wall count at 2.

  • Update the Snapmaker common process preset to initialize tree_support_wall_count to -1.

  • Change the runtime wall-count variable from an unsigned type to int so that -1 is preserved correctly.

  • Align the following tree-support behavior with Bambu Studio:

    • automatic wall-count handling
    • minimum wall-count calculation
    • default support-pattern path handling
    • non-default support-pattern path handling
    • extra-wall activation conditions
  • Ensure that extra-wall logic is triggered only when the configured value is -1.

  • Preserve explicit user settings:

    • 0 remains zero walls
    • 1 remains one wall
    • 2 remains two walls

Tooltip 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 .po files.

  • Ensure that each supported UI language displays its own translated tooltip:

    • Simplified Chinese displays Simplified Chinese
    • Traditional Chinese displays Traditional Chinese
    • Japanese displays Japanese
    • German displays German
    • French displays French
    • Other supported languages display their corresponding translations
    • English displays the original English source text
  • 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:

    • range: [-1, 2]
    • -1: Auto
    • 0: zero walls / infill-only mode
    • 1: one wall
    • 2: two walls
  • Regenerate the compiled localization resources from the updated .po files.

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/else logic was added to the C++ source code.

  • No new dependencies were introduced.

Compatibility

Older Snapmaker 3MF files may contain:

tree_support_wall_count = 0

In older Snapmaker versions, this value was presented as Auto. Under the new unified semantics, 0 means 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 0 to -1.

Users opening an older project may need to manually select -1 to restore automatic wall-count behavior.

Screenshots / Recordings / Graphs

Rectilinear

Before

Hybrid tree trunks contain broken or missing sections.
image

After

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


Rectilinear Grid

Before

Hybrid tree trunks contain broken or missing sections.
image

After

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


Honeycomb

Before

Hybrid tree trunks contain broken or missing sections.
image

After

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


Localized tooltip

Simplified Chinese

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

English

The tooltip is displayed using the English source text.
image

Other supported languages

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

Tests

Build

  • Release build completed successfully.
  • Localization resources compiled successfully.
  • Updated localization resources were copied to the runtime directory.

Configuration

  • Verified the valid configuration range is [-1, 2].
  • Verified the maximum configurable wall count remains 2.
  • Verified a new Snapmaker process preset initializes tree_support_wall_count to -1.
  • Verified a new project initializes the setting to -1.
  • Verified the UI displays Auto for -1.
  • Verified restoring the default value returns the setting to -1.

Tree support

  • Verified Hybrid Tree + Rectilinear with tree_support_wall_count = -1.
  • Verified Hybrid Tree + Rectilinear Grid with tree_support_wall_count = -1.
  • Verified Hybrid Tree + Honeycomb with tree_support_wall_count = -1.
  • Verified the original 3MF after selecting tree_support_wall_count = -1.
  • Verified explicit wall count 0 produces zero perimeter walls.
  • Verified explicit wall count 1 produces one perimeter wall.
  • Verified explicit wall count 2 produces two perimeter walls.
  • Verified other support base patterns do not regress.
  • Compared the resulting behavior with Bambu Studio using the same model and settings.

Save and reload

  • Verified saving and reopening a new 3MF preserves the value -1.
  • Verified saving and reopening an explicit zero-wall configuration preserves the value 0.
  • Verified explicit values 1 and 2 are preserved after reopening the project.

Localization

  • Verified the English interface displays the English tooltip.
  • Verified the Simplified Chinese interface displays the Simplified Chinese tooltip.
  • Verified the Traditional Chinese interface displays the Traditional Chinese tooltip.
  • Verified the Japanese interface displays the Japanese tooltip.
  • Verified the German interface displays the German tooltip.
  • Verified the French interface displays the French tooltip.
  • Verified the remaining supported languages display their corresponding translations.
  • Verified non-English interfaces do not fall back to the English tooltip.
  • Verified switching languages or restarting the application does not retain the previous language tooltip.
  • Verified the Wiki URL remains unchanged and visible.
  • Verified all translations preserve the correct -1, 0, 1, and 2 semantics.

mwz-iot added 3 commits July 21, 2026 17:33
…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.
@mwz-iot
mwz-iot requested a review from bluetianyu July 23, 2026 06:47
@mwz-iot mwz-iot self-assigned this Jul 23, 2026
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.

4 participants