Skip to content

Sheet metal: an edge flange on part of a stepped outline spans that part (#11034) - #11046

Merged
bherbruck merged 1 commit into
tangency-labs:mainfrom
LorbusChris:flange-stepped-outline
Nov 2, 2026
Merged

bherbruck merged 1 commit into
tangency-labs:mainfrom
LorbusChris:flange-stepped-outline

Conversation

@LorbusChris

Copy link
Copy Markdown
Contributor

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_each trims 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

  • New engine test in 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 on main at 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 them solidcraft-engine lib (3191 passed, 0 failed) and solidcraft-doc lib (530 passed). cargo xtask ci runs 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-gpu lib: 29 of 165 tests, all path-tracer tests on this machine's AMD Radeon 890M (RADV). On main at da50117, 29 fail as well.
    • solidcraft-ui-egui lib: 4132 passed and 2 failed. render_workspace::tests::progressive_image_controls_route_to_the_registered_host is a path-traced render ("inconsistent glass medium paths") and fails on main too. op_auto::tests::primitives_and_revolves_join_cut_or_stand_apart failed only inside the full run; run alone, it passes on this branch and on main.
    • solidcraft-ui-egui test scenarios: 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 on main.
    • The web offline test wasn't reached. With no Chrome on this machine, it would have been skipped anyway.
  • Rebased onto main at 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, in crates/doc/src/sheet.rs); the patch is unchanged. cargo fmt --check and clippy -p solidcraft-doc -p solidcraft-engine --all-targets -D warnings pass 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 from main at da50117 and from this branch, the issue's two scripts; the flat pattern's bends:

    Script main this branch
    stepped outline, flange on the X −108.9 segment one bend 403.5 long, Y 5.4–408.9 one bend 377.8 long, Y 10.5–388.3
    rectangle with the steps cut away as notches one bend 377.8 long, Y 10.5–388.3 the same

Screenshots 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) of main at da50117 and of this branch on Linux x86_64 under Xvfb, driven through the control channel (engine.execute, ui.screenshot).

Integration status

Rebased on main at 29a6bbd (2026-11-02); no conflicts. The full run above was at da50117. Open PRs changing the same function, add_flanges_each in crates/doc/src/sheet.rs, each add a value to the same found tuple 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

…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
@github-actions github-actions Bot added the area:doc timeline, components, parameters, naming label Nov 2, 2026
@bherbruck bherbruck added ready to merge reviewed, every ask addressed; merge once CI is green approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) and removed approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Nov 2, 2026
@bherbruck
bherbruck enabled auto-merge November 2, 2026 13:32
@bherbruck bherbruck added approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) and removed approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Nov 2, 2026
@bherbruck
bherbruck added this pull request to the merge queue Nov 2, 2026
Merged via the queue into tangency-labs:main with commit 3916314 Nov 2, 2026
106 of 119 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) area:doc timeline, components, parameters, naming ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sheet metal: an edge flange picked on one segment of a stepped outline runs the base face's whole length

2 participants