Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Retest: joints mate face to face and Drive Joints takes the keyboard (4c3a5d9): s07/s20 type the angle straight away and check B sits on A's top (z 10..20); harness bbox check measures bodies as placed

bherbruck3d384c7de712
diff --git a/crates/ui-egui/src/scenario.rs b/crates/ui-egui/src/scenario.rs
index 4d518bc284..4afef865d0 100644
--- a/crates/ui-egui/src/scenario.rs
+++ b/crates/ui-egui/src/scenario.rs
@@ -446,6 +446,21 @@ pub fn check(h: &mut Harness, e: &Value) -> Result<(), String> {
return Err(format!("named views: got {n}, want {v}"));
}
}
+ "bbox" => {
+ // {body, min?: [x|null, y|null, z|null], max?: […]}: where a body is (±1e-3 mm).
+ let name = v["body"].as_str().unwrap_or_default();
+ // Where it is in the assembly (measured as placed).
+ let m = h.call("engine.execute", json!({"command": "MeasureCommand", "params": {"bodies": [name]}}))["result"].clone();
+ let b = m["bodies"].as_array().and_then(|a| a.first()).cloned().ok_or_else(|| format!("no body {name}: {m}"))?;
+ for side in ["min", "max"] {
+ for (i, want) in v[side].as_array().into_iter().flatten().enumerate() {
+ let (Some(w), Some(g)) = (want.as_f64(), b["bbox"][side].get(i).and_then(Value::as_f64)) else { continue };
+ if (w - g).abs() > 1e-3 {
+ return Err(format!("{name} bbox {side}[{i}]: got {g}, want {w}"));
+ }
+ }
+ }
+ }
"home" => {
if ui["home"] != *v {
return Err(format!("start page open: got {}, want {v}", ui["home"]));
diff --git a/crates/ui-egui/tests/scenarios/s07_components_joint_drive.json b/crates/ui-egui/tests/scenarios/s07_components_joint_drive.json
index 1d7e8e1315..10c1970f5f 100644
--- a/crates/ui-egui/tests/scenarios/s07_components_joint_drive.json
+++ b/crates/ui-egui/tests/scenarios/s07_components_joint_drive.json
@@ -188,14 +188,24 @@
}
},
{
- "start": "FusionMoveJointsCommand"
- },
- {
- "widget": "0 deg"
+ "expect": {
+ "bbox": {
+ "body": "Body2",
+ "min": [
+ null,
+ null,
+ 10
+ ],
+ "max": [
+ null,
+ null,
+ 20
+ ]
+ }
+ }
},
{
- "key": "A",
- "cmd": true
+ "start": "FusionMoveJointsCommand"
},
{
"text": "90"
diff --git a/crates/ui-egui/tests/scenarios/s20_section_with_joint_drive.json b/crates/ui-egui/tests/scenarios/s20_section_with_joint_drive.json
index 4d4bdea13a..6d8dff91a9 100644
--- a/crates/ui-egui/tests/scenarios/s20_section_with_joint_drive.json
+++ b/crates/ui-egui/tests/scenarios/s20_section_with_joint_drive.json
@@ -192,9 +192,6 @@
"plane": "XZ"
}
},
- {
- "debug": 1
- },
{
"key": "Enter"
},
@@ -210,13 +207,6 @@
{
"start": "FusionMoveJointsCommand"
},
- {
- "widget": "0 deg"
- },
- {
- "key": "A",
- "cmd": true
- },
{
"text": "90"
},