From f96aaa2a9852f906d815a7bc6dcd4fda3531469b Mon Sep 17 00:00:00 2001 From: MateuszSychXpl <151755914+MateuszSychXpl@users.noreply.github.com> Date: Fri, 16 Oct 2026 14:39:15 +0200 Subject: [PATCH] Motion analysis: a check that runs out before its first step says so, Contact sets offered only when one is active --- crates/engine/src/cmd/motion_analysis.rs | 4 ++++ crates/ui-egui/src/dialogs_motion_plot.rs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/motion_analysis.rs b/crates/engine/src/cmd/motion_analysis.rs index 34e030ec..d842d9c9 100644 --- a/crates/engine/src/cmd/motion_analysis.rs +++ b/crates/engine/src/cmd/motion_analysis.rs @@ -391,6 +391,10 @@ pub(super) fn interference(s: &mut Session, p: &Value) -> Result { } Ok(true) })?; + // Nothing checked is not clear. + if truncated && checked == 0 { + return Err(bad(cmd, "the check ran out of its work budget before its first step: check fewer parts (occurrences, against)")); + } let mut list: Vec<(&(u64, u64), &Collision)> = found.iter().collect(); list.sort_by_key(|(_, c)| c.samples.first().copied().unwrap_or(usize::MAX)); let mut booleans = MAX_BOOLEANS; diff --git a/crates/ui-egui/src/dialogs_motion_plot.rs b/crates/ui-egui/src/dialogs_motion_plot.rs index f0a6f144..28929992 100644 --- a/crates/ui-egui/src/dialogs_motion_plot.rs +++ b/crates/ui-egui/src/dialogs_motion_plot.rs @@ -248,7 +248,9 @@ fn collision_rows( ) { // Collisions over the whole study: of the picked components (against the other picks, if // any), else among all components or in the contact sets. - let sets = !app.session.doc.assembly.contact_sets.is_empty() || app.session.doc.assembly.contact_all; + // Offered when there is a set to check (suppressed ones don't count). + let assembly = &app.session.doc.assembly; + let sets = assembly.contact_all || assembly.contact_sets.iter().any(|c| !c.suppressed); a.among = if sets { a.among.min(1) } else { 0 }; let (parts, against) = (picked_occurrences(&app.session, inputs, 1), picked_occurrences(&app.session, inputs, 2)); let among = if !parts.is_empty() {