Skip to content

fix: regenerate tree supports on move and grow branch bases near the bed - #789

Open
zackaree-shen wants to merge 2 commits into
Snapmaker:release_2_3_7from
zackaree-shen:bugfix_tree_support_regen_expand
Open

fix: regenerate tree supports on move and grow branch bases near the bed#789
zackaree-shen wants to merge 2 commits into
Snapmaker:release_2_3_7from
zackaree-shen:bugfix_tree_support_regen_expand

Conversation

@zackaree-shen

Copy link
Copy Markdown

Note: Supersedes #782. The head branch has been migrated to this fork per the branch cleanup policy (personal dev branches are no longer allowed on Snapmaker/OrcaSlicer).

Description

Two independent tree-support fixes:

1. Tree supports were not regenerated after moving / centering an object

  • Tree support branches are routed against the machine border (bed bounds) anchored to the instance shift, but PrintObject::set_instances() only invalidated the Print-level steps (psSkirtBrim, psGCodeExport) on a pure XY translation, which never cascade to the PrintObject-level posSupportMaterial step.
  • Result: after moving or centering an object, slicing kept reusing the supports computed for the old position, until some support option was toggled back and forth.
  • Fix: for tree-support objects, also invalidate posSupportMaterial on instance changes. Regular supports are computed in object coordinates and stay valid on translation, so the cheap skirt/gcode-only invalidation is kept for them (no performance regression when dragging objects).

2. Tree support branches spill out of grooves/cavities (ported from BambuStudio d61ebefa2, STUDIO-18228/18439, OrcaSlicer#10542/OrcaSlicer#10775)

  • Grow branch radius by half an extrusion width per layer for nodes in the first ~2 mm above the bed (when wall count is auto or dual-wall), so tree bases fill cavities/grooves instead of spilling out of them.
  • DO_NOT_MOVER_UNDER_MM becomes a class constant of 2.0 mm (was a local is_slim ? 0 : 5).
  • drop_nodes(): add bottom_expand_enabled gate and apply the radius growth when dropping nodes near the bed.

Screenshots/Recordings/Graphs

To be attached during manual validation (groove test model): before this PR the groove model produced 559 fine support markers spilling outside the groove (vs BambuStudio 37 stout markers inside).

Tests

  • Full Release build via VS2022 (orca-build) - compiles clean, app runs
  • Manual: groove model - slice, then center the object, then re-slice: supports must be regenerated (G-code support markers change)
  • Manual: branch bases near the bed are thicker and stay inside the groove
  • Note: automated slice tests are not runnable in this fork (pre-existing test-infra limitation, verified against a stash baseline)

Tree support branches are routed against the machine border anchored to
the instance shift, so a pure XY move (drag / center / arrange) made the
cached support layers stale: the sliced G-code kept the supports computed
for the old position until a config option was toggled.

set_instances() only invalidated psSkirtBrim/psGCodeExport (Print-level
steps), which never cascade to posSupportMaterial (PrintObject-level).
Now tree-support objects also invalidate posSupportMaterial on instance
changes. Regular supports are computed in object coordinates and stay
valid on translation, so the cheap invalidation is kept for them.
Grow branch radius by half an extrusion width per layer for nodes in the
first ~2 mm above the bed (when wall count is auto or dual-wall), so tree
bases fill cavities/grooves instead of spilling out of them.

- DO_NOT_MOVER_UNDER_MM becomes a class constant of 2.0 mm (was a local
  is_slim ? 0 : 5), matching BambuStudio behavior
- drop_nodes(): add bottom_expand_enabled gate and apply the radius
  growth when dropping nodes near the bed

Refs BambuStudio STUDIO-18228/18439 (OrcaSlicer#10542/OrcaSlicer#10775)
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.

1 participant