Skip to content

[WIP] Sheet metal: Fold of a tab between slanted slits keeps the plate in one piece (#24259) - #24532

Closed
MarkusReichart wants to merge 1 commit into
tangency-labs:mainfrom
MarkusReichart:fix/24259-fold-slit-pieces
Closed

MarkusReichart wants to merge 1 commit into
tangency-labs:mainfrom
MarkusReichart:fix/24259-fold-slit-pieces

Conversation

@MarkusReichart

Copy link
Copy Markdown
Contributor

Change

Fixes #24259. Claiming this.

Plan: the fold's bend zone is the rectangle over its tab's reach, so past each slanted slit it also covers a small triangle of the plate. Cutting the slits from the zone leaves that triangle as a tab of the zone (sort_zones in crates/doc/src/sheet_surface.rs), and it rides up with the folded tab while the plate keeps the same material. The fix takes from a zone piece that only one tangent line holds what the panel pieces already hold, and drops it when nothing is left. Test first: the collar's folds in crates/engine/src/cmd/sheet_tests.rs checked for one shell and the folded volume.

Boundary: #20684 changes pieces() in the same file (each zone less its cuts); this PR changes only sort_zones and leaves those lines alone.

Changes a default: no

Co-written and tested with Claude Code (AI).

…, claim

Co-Authored-By: Claude Code <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@alfonsotames

Copy link
Copy Markdown
Contributor

@MarkusReichart, sorry for the overlap: I had this working before I saw your claim and opened #24579 for it, which CI now flags as a duplicate of yours. Your plan matches what I found: the zone's corners past the slanted slits, kept as tabs in sort_zones. Two things from doing it that may save you time:

  1. Dropping what the plate's pieces hold isn't quite enough.
    • The plate's trim stops it a little short of the zone, so a sliver of each corner (0.004 mm² in the collar) is held by no panel. It has to stay flat with the plate, as a tab of the zone's other panel, or the flat loses it.
    • Once a side tab is folded too, the corners lie on the next tab's bend zone instead of on the plate, so the cut has to take what the other bends' zones hold as well.
    • I cut them one tool at a time, since the planar booleans don't take several tools that share an edge. And I only touch a tab that shares no edge along the bend with its own panel (solidcore's shared_edge_ways), so every other tab is as before.
  2. A second bug in the same collar that a shell count doesn't show. After a side fold, the flat loses a 0.2 mm² triangle beside each slit. Fold's plan cuts what its zone lacks past its ends from every piece of the flat, and at a collar's corner that takes a corner of the first tab's bend (sheet_surface_features.rs, beside the FOLD_ZONE_OVER_FLAT_PANEL gap check). On main the collar can't be unfolded after any of its folds ("sew: ambiguous edge contact"), and after all four its flat pattern's cut-out is 0.796856 mm² larger than drawn.

#24579 has both fixes. Its collar test checks one shell after each fold, and that the collar unfolds to the plate's volume to 1e-9. It also has before/after pictures. You're welcome to take any of it into #24532 (branch alfonsotames/solidcraft:sheet-fold-slanted-slits). Or, if you'd rather, close your claim and I'll carry #24579. Your call, I'll go with it.

🤖 Generated with Claude Code

@MarkusReichart

Copy link
Copy Markdown
Contributor Author

Stepping back from this one: @alfonsotames's #24579 covers all of #24259 by its description (one shell after the fold, and Unfold accepted again), and it is further along than this draft, which only holds the claim commit. I'm closing this draft so the claim on #24259 rests with #24579.

What I had found locally points the same way as #24579, so there is nothing extra to hand over: the bend zone between the slanted slits left small triangles that no panel held, and the side bend's cut-out took a sliver off the flat beside each slit.

Written with Claude Code (AI) on behalf of @MarkusReichart.

@alfonsotames

Copy link
Copy Markdown
Contributor

@MarkusReichart, thank you for stepping back so quickly, and for confirming the two findings from your side. I'll carry #24259 in #24579.

🤖 Generated with Claude Code

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.

Sheet metal: Fold of a tab between slanted slits leaves two loose pieces in the body (3 shells)

2 participants