Repository navigation
Feature windows choose Join, New Body or Cut from what the material touches (#6901) - #6903
Merged
bherbruck merged 9 commits intoOct 28, 2026
Merged
Conversation
froglemonade2
marked this pull request as ready for review
October 26, 2026 06:35
froglemonade2
force-pushed
the
auto-join-new-cut-6901
branch
7 times, most recently
from
October 27, 2026 22:39
afdb8b1 to
9727239
Compare
froglemonade2
force-pushed
the
auto-join-new-cut-6901
branch
from
October 28, 2026 13:13
9727239 to
8f9b746
Compare
bherbruck
added this pull request to the merge queue
Oct 28, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 28, 2026
froglemonade2
force-pushed
the
auto-join-new-cut-6901
branch
from
October 28, 2026 18:56
8f9b746 to
dac0c3c
Compare
…ouches (tangency-labs#6901) Extrude, Revolve, Loft, Sweep, Coil and the Box, Cylinder, Sphere and Torus choose their operation by running the Join on a copy of the design off the window thread and counting the pieces: Join when the material makes one body with what it touches, New Body when it would be a separate piece, Cut when it lies inside a body (Revolve and the four primitives; Extrude keeps its own Cut). The choice changes only when a check is in, a pick in the Operation row (the shown option included) stops it for good, and OK waits for a running check. Hidden bodies take no part: with some hidden, the shown ones become the feature's targets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…strings, gallery entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he evaluated Join Material touching no body is a New Body without running the Join (the contact test costs 0-240 ms where the Join costs seconds on a large body). Inside is told from display-mesh volumes instead of exact ones (8 s on a 400-hole plate). The check evaluates the Join through Session::ahead, and OK of the same commands takes it (Session::prime) rather than computing it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preferences > Design gets "Choose the operation automatically" (auto_operation, on by default). Off, feature windows don't choose Join, New Body or Cut from what their material touches: each keeps the operation it opens with (Extrude its own Join or Cut), no check runs and OK doesn't wait for one, as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce and its preference Arabic, Hebrew and Vietnamese are complete catalogs now, and Turkish has a full catalog, so this change's three strings get them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t choose A window's operation check kept running after the window closed, a Join on the design for nothing, and the test harness waited for it after every step: the icon audit, which opens every window, took ~30 min instead of ~1. The check now runs under a Progress, and closing the window (or one that doesn't choose) abandons it: its evaluation stops at the next feature and nothing waits for it. The icon audit turns auto_operation off, as it only looks at icons (75 s again). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test tangency-labs#6248 added places a box that overlaps Base and expects a second body; with tangency-labs#6901 the window would join or cut it. The test is about where the box goes, so it turns auto_operation off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bherbruck
force-pushed
the
auto-join-new-cut-6901
branch
from
October 28, 2026 19:19
dac0c3c to
3f600ff
Compare
bherbruck
added this pull request to the merge queue
Oct 28, 2026
Merged
via the queue into
tangency-labs:main
with commit Oct 28, 2026
02ac56d
24 of 27 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.
Fixes #6901.
Feature windows that add material choose Join, New Body or Cut from what the material actually does, until you pick one yourself. Hidden bodies take no part.
How it decides
The window asks the engine what its material does when joined (
solidcraft_engine::Ahead::addition, off the window thread):Body::meets); no boolean.join_pieces_added, factored out ofnote_join_apart): a separate piece → New Body, one body (or fewer pieces, a bridge) → Join. So the choice is exactly what OK makes, and the Join: say so when the joined piece doesn't touch the body #4434 warning never fires on an automatic choice. The contact test alone isn't enough: it counts a 0.001 mm gap or a pin with 0.01 mm clearance as touching, while the Join leaves two pieces.Session::prime, as OK-off-thread already does), so the boolean is not computed twice.Timing and races (
crates/ui-egui/src/op_auto.rs)ui_kit::dropdown_picked): a check running at the time, or finishing later, can't change it. In Extrude the pick stops its own automatic choice in the same frame (it used to be overwritten before the next update saw it).settlewaits for a running check.Hidden bodies
With some bodies of the scope hidden, a new feature's Join/Cut/Intersect names the shown ones as its
targets(solidcraft_engine::shown_scope), so a hidden body is never joined or cut and showing it later changes nothing. With none shown: New Body, and a hand-picked Join/Cut says "No shown body to change: show one, or choose New Body". This is the implicit "visible = in scope" behaviour; it doesn't add a targets picker (#2465 does that for Extrude).Before / after
A 30 × 30 × 10 block, a separate sketch with a rectangle standing apart from it, Extrude opened on it.
main(ece2a86)Basein 2 pieces, warning in HistoryA block against the block's side wall still opens on Join:
Cost of the check
Measured in the
ciprofile (opt-level 1) on this 8-core desktop; release is faster:Preference
Preferences › Design › Choose the operation automatically (
auto_operation, on by default). Off: no window chooses; each keeps the operation it opens with (Extrude its own Join or Cut), no check runs and OK doesn't wait for one, as before this change.ui.prefs {"auto_operation": false}sets it over the control channel. Test:op_auto_tests::with_the_preference_off_the_window_keeps_its_operation(and saved settings without the key load with it on).Validation
crates/engine/src/cmd/join_pieces_tests.rs: the verdict equals what a real Join makes (ring round a hole, pin filling a bore, flush and half-flush walls, a block past an edge, a bridge between pieces, 0.001 / 0.01 mm gaps, a pin clear in its bore, far blocks), Inside for a box/ring within a body, hidden bodies out of scope, no verdict for Cut, Combine, fillets or an empty design.crates/ui-egui/src/op_auto_tests.rs: Extrude apart → New Body (2 bodies after OK), touching → Join with OK taking the evaluated Join; ring round a hole; sphere apart / on / inside → New Body / Join / Cut; a hand pick made while the check runs stays (Extrude and a primitive, the shown option included); OK pressed at once waits for the check; hidden bodies; an edited feature keeps its operation.apply_off_thread_testsswitch the window's own check off (they test OK computing).Rebased onto main 2026-10-28 (head 3f600ff on 48ba6ff). After #6683 made list parameters strict, the operation check reads the Join's
targets/participantswithstring_list_or_default(a preview: a wrong type only widens the contact pre-test, and the Join itself then refuses it, so the check gives no verdict). #3135 now computes OK's whole transaction off the window thread, so "OK takes the evaluated Join" primes that computation's scratch session (DialogComputation::new),compute_commands_innerunprimes the session it hands back so nothing primed reaches the adopted design, and OK on the window thread (web, previews off) primes aroundrun_dialog(run_primed). #6766'sexact_regionsand this PR's shown-bodytargetsare both applied inapply_commands.Overlap with #5148 and #6894, which landed meanwhile: both keep hidden bodies out in the engine, per command (#5148 an Extrude Cut/Intersect, #6894 a Loft Join), where this PR does it once in the feature window for every Join/Cut/Intersect it makes. They agree: the window stores the shown bodies as explicit
targets, so those engine paths don't run for a window-made feature, and both refuse when every body is hidden. #5148's privateshown_scopeand this PR's public one are now one function (Option: None when all are shown); #5148's call keeps its behaviour withunwrap_or_default().Closing a window stops its check: the check runs under a
Progressand a window that closes (or no longer chooses) abandons it, so its evaluation stops at the next feature and nothing waits for it (op_auto_tests::closing_the_window_stops_its_check). Before this, the test harness waited for a closed window's check after every step, which madeicon_audittake ~30 min instead of ~1; it now runs withauto_operationoff (it only looks at icons) and takes 75 s. #6248's Box placement test makes a box that overlaps its base, which the window would now join or cut, so it also turns the choice off.Local validation:
sc pron afdb8b10 (main 95ff76c): fmt, clippy -D warnings, xtask assets/icons/licences/lists/layers/ui-containers, wasm32 check pass; tests of solidcraft-engine, solidcraft-ui-egui, solidcraft-doc plus the heavy command contracts (atomic_commands,hostile_params_never_panic) and the UI acceptance scenario: 6160/6160 pass. Left to PR CI: the suites of the other crates that depend on these. Left to the merge queue: robustness goldens, kernel stress, enclosure regressions, nightly property, doc and reference tests, Windows jobs.sc checkpass;solidcraft-ui-egui3404/3404,solidcraft-engine2625/2625,solidcraft-doc474/474 pass. PR CI (Native Linux tests and Clippy) passed on 8f9b7462, two rebases earlier, both for conflicts.Related: Join: say so when the joined piece doesn't touch the body #4434 (the warning this keeps from firing), Extrude Join/Cut changes hidden bodies too, and the dialog can't pick its target bodies #2464 / Join remains an option during an extrude operation when no bodies are visible. #5481 (hidden bodies joined), RFC: an option to refuse a Join whose material doesn't touch the body #6902 (RFC: an option to refuse a Join apart).
Changes a default: yes — Extrude, Loft and Sweep choose New Body for material apart, and Revolve, the primitives and Coil choose Join or Cut where the material meets a body (hidden bodies are left out of a new feature's Join or Cut either way, as #5148 and #6894 now do in the engine), old behaviour kept behind preference
auto_operation🤖 Generated with Claude Code