From 5489599c0d4d29cc9a716c833083bb00baa50a5e Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 01:13:13 -0400 Subject: [PATCH] Tests: a face with no attachment is a rib's wall, whose feature reports no roles unsupported_face_has_explicit_fixed_alternative_and_no_live_projection needs a planar face with neither a construction certificate nor an exact history name, so a sketch on it must be fixed. Its face, a split top face offset up, now keeps its history through SMLib's offset and gets a name. A rib reports no roles for the faces it builds (Traced::unnamed, eval_more), so a rib's wall has neither: the test now picks the wall at y = 12 of a rib in a bracket's corner. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/sketch_face_tests.rs | 25 +++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/sketch_face_tests.rs b/crates/engine/src/cmd/sketch_face_tests.rs index 237ff8b96..c5934a4b9 100644 --- a/crates/engine/src/cmd/sketch_face_tests.rs +++ b/crates/engine/src/cmd/sketch_face_tests.rs @@ -75,11 +75,26 @@ fn explicit_rebind_preserves_geometry_dimensions_context_and_one_undo() { #[test] fn unsupported_face_has_explicit_fixed_alternative_and_no_live_projection() { let mut s = Session::default(); - // A top half Offset Face raised: no construction certificate and no exact history name yet. - run(&mut s, "solid.box", json!({"length":40,"width":30,"height":20,"body_name":"Base"})); - run(&mut s, "solid.split_face", json!({"faces":[[10,15,20]],"plane":{"origin":[20,0,0],"normal":[1,0,0]}})); - run(&mut s, "solid.offset_face", json!({"faces":[[10,15,20]],"distance":5})); - let mut pick = top_pick(&s, "Base"); + // A rib's wall: a rib reports no roles for the faces it builds (Traced::unnamed), so the + // wall has no construction certificate and no exact history name to attach by. + run(&mut s, "solid.box", json!({"length":40,"width":20,"height":5,"corner":[0,0,0],"body_name":"L"})); + run(&mut s, "solid.box", json!({"length":5,"width":20,"height":40,"corner":[0,0,0],"operation":"join"})); + run(&mut s, "sketch.create", json!({"plane":{"origin":[0,10,0],"x_dir":[1,0,0],"y_dir":[0,0,1]},"name":"RibSketch"})); + run(&mut s, "sketch.line", json!({"points":[[5,25],[25,5]],"ids":["l1"]})); + run(&mut s, "sketch.finish", json!({})); + run(&mut s, "solid.rib", json!({"sketch":"RibSketch","curves":["l1"],"thickness":4})); + let mut pick = { + let world = s.world_state().unwrap(); + let body = world.body("L").unwrap(); + let face = body + .body + .faces(0.01) + .unwrap() + .into_iter() + .find(|face| face.plane_normal.is_some_and(|n| n.dot(Vec3::Y) > 0.999) && (face.centroid.y - 12.0).abs() < 1e-6) + .unwrap(); + json!({"body":"L","index":face.index,"face":[face.centroid.x,face.centroid.y,face.centroid.z]}) + }; let before = s.doc.to_json(); let error = s.execute("sketch.create", &json!({"plane":pick})).unwrap_err(); assert!(error.to_string().contains("fixed"), "{error}");