SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
test: failing regression test for #544 (ignored until fixed): Blind Ø2 hole into a long D-profile bar is refused ("exact fallback … takes planar faces only") although it stays clear of the round face (#551)
Jonas Wrede7a8754bef7a4
diff --git a/crates/engine/src/boolean_regression_tests.rs b/crates/engine/src/boolean_regression_tests.rsindex d030f24398..fabaecf9c3 100644--- a/crates/engine/src/boolean_regression_tests.rs+++ b/crates/engine/src/boolean_regression_tests.rs@@ -88,3 +88,22 @@ fn struts_ending_on_a_bore_wall_join_without_a_panic() {result.unwrap();assert_eq!(s.model.state().bodies.len(), 1);}++/// A blind Ø2 hole into the flat back of a long D-profile bar ends 2 mm short of the round front,+/// yet the cut was refused (#544). It removes π · 1² · 10 mm³ (within 5 %: the measure tessellates+/// the small bore) and adds the bore's wall and floor to the bar's six faces.+#[test]+#[ignore = "fails until #544 is fixed"]+fn blind_hole_into_a_long_d_profile_bar_stops_short_of_the_round_front() {+ let script: Value = serde_json::from_str(include_str!("../../../examples/regressions/blind_hole_in_long_d_profile.json")).unwrap();+ let steps = script.get("commands").and_then(Value::as_array).unwrap();+ let mut s = Session::default();+ s.run_script(&Value::Array(steps[..5].to_vec())).unwrap();+ let bar = volume(&s, "Slat");+ s.run_script(&Value::Array(steps[5..].to_vec())).unwrap();+ let hole = std::f64::consts::PI * 10.0;+ let removed = bar - volume(&s, "Slat");+ assert!((removed - hole).abs() < 0.05 * hole, "removed {removed} vs {hole}");+ let faces = s.model.state().body("Slat").map(|b| solidcraft_kernel::measure(&b.body).unwrap().merged.faces);+ assert_eq!(faces, Some(8));+}diff --git a/examples/regressions/blind_hole_in_long_d_profile.json b/examples/regressions/blind_hole_in_long_d_profile.jsonnew file mode 100644index 0000000000..75841b7e90--- /dev/null+++ b/examples/regressions/blind_hole_in_long_d_profile.json@@ -0,0 +1,14 @@+{+ "description": "A blind 2 mm hole drilled 10.5 mm from 0.5 mm behind the flat back of a 452 mm D-profile bar (flat back 9.2 wide at x = -7.4, half-round front R 4.6 reaching x = 4.6). The hole ends at x = 2.6, 2 mm inside the material and clear of the round face, but the cut was refused: the exact fallback takes planar faces only, and the nudged tool gave an implausible volume (#544). The same cut works on a 350 mm bar. Result: the bar less pi * 1^2 * 10 mm3.",+ "commands": [+ {"command": "sketch.create", "params": {"plane": "XY", "name": "D"}},+ {"command": "sketch.line", "params": {"points": [[0, 4.6], [-7.4, 4.6], [-7.4, -4.6], [0, -4.6]], "closed": false}},+ {"command": "sketch.arc.center_point", "params": {"center": [0, 0], "start": [0, -4.6], "end": [0, 4.6]}},+ {"command": "sketch.finish", "params": {}},+ {"command": "solid.extrude", "params": {"sketch": "D", "distance": 452.0, "body_name": "Slat"}},+ {"command": "sketch.create", "params": {"plane": {"origin": [-7.9, 0, 0], "x_dir": [0, 1, 0], "y_dir": [0, 0, 1]}, "name": "H"}},+ {"command": "sketch.circle.center", "params": {"center": [0, 35.0], "radius": 1}},+ {"command": "sketch.finish", "params": {}},+ {"command": "solid.extrude", "params": {"sketch": "H", "distance": 10.5, "operation": "cut", "targets": ["Slat"]}}+ ]+}