Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
This commit is contained in:
1 parent
f538eeb5fa
commit
ef9bb0db09
1 file changed
+16
@@ -1737,3 +1737,19 @@ fn fold_keeps_working_when_a_parameter_moves_the_sheet_off_its_fixed_point() {
|
||||
assert!((bb["max"][0].as_f64().unwrap_or(0.0) - 80.0).abs() < 1e-6, "{bb}");
|
||||
assert!(bb["max"][2].as_f64().unwrap_or(0.0) > 30.0, "{bb}");
|
||||
}
|
||||
|
||||
/// `fixed` 20 mm above a 2.5 mm sheet touches no material: refuse it or say so, like a point in a
|
||||
/// cut-out (#371).
|
||||
#[test]
|
||||
#[ignore = "fails until #371 is fixed"]
|
||||
fn fold_fixed_point_above_the_sheet_is_not_silently_accepted() {
|
||||
let mut s = Session::default();
|
||||
base(&mut s, 100.0, 60.0);
|
||||
match s.execute("sheet.fold", &json!({"points": [[40, 0, 2.5], [40, 60, 2.5]], "fixed": [90, 30, 20]})) {
|
||||
Err(e) => assert!(e.to_string().contains("fixed"), "{e}"),
|
||||
Ok(r) => {
|
||||
let warned = ["warning", "warnings"].iter().any(|k| r.get(*k).is_some_and(|w| w.to_string().contains("fixed")));
|
||||
assert!(warned, "fixed [90, 30, 20] is 17.5 mm above the sheet, yet the fold succeeded silently: {r}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user