Repository navigation
Sheet metal: an edge flange on part of a stepped outline spans that part (#11034) - #11046
Merged
Merged
Conversation
…art (tangency-labs#11034) A flange picked on one segment of a stepped base outline ran the base face's whole length: trimming the picked edge back to the bend line merged it with the outline's own edge on that line beyond the step, and the flange took the merged edge. It now stays off the base's edges that already lay on the bend line, so it spans the segment picked, with no relief there: the base is already back at the bend line. The same outline made by cutting notches into a rectangle gave the right flange already. Assisted-by: LLM
bherbruck
enabled auto-merge
November 2, 2026 13:32
Merged
via the queue into
tangency-labs:main
with commit Nov 2, 2026
3916314
106 of 119 checks passed
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.
Change
Fixes #11034. An edge flange picked on one segment of a stepped base outline ran the base face's whole length: a 20 mm flange on a left edge that steps out 2 mm between Y 10.5 and 388.3 bent over 403.5 (Y 5.4–408.9), not the 377.8 of the segment.
The cause:
add_flanges_eachtrims the picked edge back to the bend line, and on a stepped outline that line is where the base's own edges already run beyond the step. The trimmed edge merged with them, and the flange took the merged edge. Now, before trimming, the flange notes where the base's outline already runs along the bend line on either side of the picked edge (SheetBody::bend_line_runs), and keeps off those stretches afterwards. So it spans the segment picked, with no relief there: the base is already back at the bend line. A flange on another flange's edge, or on an outline without steps, is unchanged, and so is the outline made by cutting notches into a rectangle, which gave the right flange already.Changes a default: no
Validation
crates/engine/src/cmd/sheet_tests.rs,a_flange_on_part_of_a_stepped_outline_spans_that_part: the outline from the issue, 1 mm thick (R 1, K 0.44), a 20 mm flange on the X −108.9 segment. Expected: one bend 377.8 long from Y 10.5 to 388.3, and a flat area of the trimmed base (215.8 × 403.5) plus the bend allowance and the 18 mm leg along 377.8, to 1e-9: no relief cut. Without this change the test fails with one bend 403.5 long, Y 5.4–408.9.Run on Linux x86_64 (Fedora 44, Rust 1.99.1),
--profile ci, on this branch onmainat da50117:cargo xtask ci: fmt, assets, icons, licences, lists, skills, layering, UI containers,clippy --workspace --all-targets -D warnings, the wasm check and the doc tests pass. 81 of the 84 test binaries pass, among themsolidcraft-enginelib (3191 passed, 0 failed) andsolidcraft-doclib (530 passed).cargo xtask ciruns the test binaries at once (a load average above 400 on this machine's 24 threads), so timing-sensitive tests can fail inside the full run and pass alone. The three that fail have failures unrelated to this change:solidcraft-gpulib: 29 of 165 tests, all path-tracer tests on this machine's AMD Radeon 890M (RADV). Onmainat da50117, 29 fail as well.solidcraft-ui-eguilib: 4132 passed and 2 failed.render_workspace::tests::progressive_image_controls_route_to_the_registered_hostis a path-traced render ("inconsistent glass medium paths") and fails onmaintoo.op_auto::tests::primitives_and_revolves_join_cut_or_stand_apartfailed only inside the full run; run alone, it passes on this branch and onmain.solidcraft-ui-eguitestscenarios: 146 passed and 1 failed,s15_start_page_sample_save_reopen("step 3: timed out: start page open"). Run alone, it passes on this branch and onmain.Rebased onto
mainat 29a6bbd, whose new commits include Sheet metal: a fold crosses slanted or curved edges of any panel (#10621) #10922 (a fold across slanted or curved edges, incrates/doc/src/sheet.rs); the patch is unchanged.cargo fmt --checkandclippy -p solidcraft-doc -p solidcraft-engine --all-targets -D warningspass there;cargo test -p solidcraft-doc --lib: 538 passed, and-p solidcraft-engine --lib flange sheet fold: 271 passed, 0 failed.Reproduction with
solidcraft-cli run, built frommainat da50117 and from this branch, the issue's two scripts; the flat pattern's bends:mainScreenshots of the behavior (when observable)
The issue's stepped outline with a 20 mm flange picked on the stepped segment, in 3D and in the flat pattern.
Before (
main): the flange runs the base face's whole length, past both ends of the segment; in the flat pattern its bend line spans the whole 403.5.After: the flange spans the segment, Y 10.5–388.3: in 3D it stops 5.1 short of the near corner and 20.6 short of the far one, and in the flat pattern the base's outline steps back at both ends of the bend.
Captured from desktop builds (
--profile ci) ofmainat da50117 and of this branch on Linux x86_64 under Xvfb, driven through the control channel (engine.execute,ui.screenshot).Integration status
Rebased on
mainat 29a6bbd (2026-11-02); no conflicts. The full run above was at da50117. Open PRs changing the same function,add_flanges_eachincrates/doc/src/sheet.rs, each add a value to the samefoundtuple and its two loops, so whichever lands second has a small mechanical conflict there:Other open sheet metal PRs (#7652, #10356, #9966, #9714, #6855, #8512, #7582) merge cleanly alongside it. #5943 (partial flanges) asks for set-backs and more; this only makes a flange on a stepped outline's segment stay on that segment.
Assisted-by: LLM