Compare commits

...

1 Commits

Author SHA1 Message Date
bherbruck 7b5fdbb763 Kernel: a far-moved disjoint sphere and box union, ignored until solidcore#3131
Found by translation_invariant at PROPTEST_CASES=200 on solidcore a445bdaac6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 20:33:43 -05:00
2 changed files with 17 additions and 0 deletions
@@ -8,3 +8,4 @@ cc 739d5cbd9e471e0ff65bc2b7c1b9a323c2e769939c73def2e74fb17b0536c1d0 # shrinks to
cc 0f8ee4d4597db6bdec2ad2cc7e5cfe7d4ebba351e24642118135da34bf489d0c # shrinks to a = Sph { at: [20.0, 10.0, 27.5], r: 3.75 }, b = Box { at: [15.0, 0.0, 22.5], size: [7.5, 20.0, 5.0] }
cc 2adfe5ac6b6916fa22a415348bdd7ece29ad33e8114b94dea86ba8bc39156dee # shrinks to a = Box { at: [15.0, 22.5, 0.0], size: [5.0, 5.0, 17.5] }, b = Box { at: [2.5, 12.5, 0.0], size: [12.5, 10.0, 5.0] }
cc 00931f1657c5f31ab3593ef30eb6f452eddcf3fd0662d280ca2f6a86a409666b # shrinks to a = Cyl { at: [12.5, 5.0, 5.0], axis: 2, r: 2.5, h: 17.5 }, b = Box { at: [10.0, 5.0, 7.5], size: [12.5, 5.0, 10.0] }, k = 0.05
cc 5b2daab79ffc39bc696b22704b0372147902f58c68cef280279ca38bf5d5d32f # shrinks to a = Sph { at: [0.0, 0.0, 10.0], r: 2.5 }, b = Box { at: [0.0, 0.0, 0.0], size: [5.0, 5.0, 5.0] }, off = 100000.0
+16
View File
@@ -318,6 +318,22 @@ fn grid_small_sphere_thin_box_union_is_sound() {
check(identity(&a, &b));
}
/// A sphere and a box apart from each other: moved 1e5 mm away, their union is refused ("a NURBS
/// form that is not its analytic surface"), where at the origin it is the two solids.
#[test]
#[ignore = "kernel bug, solidcore#3131"]
fn disjoint_sphere_box_union_moved_far() {
let a = Prim::Sph { at: [0.0, 0.0, 10.0], r: 2.5 }.body();
let b = Prim::Box { at: [0.0, 0.0, 0.0], size: [5.0, 5.0, 5.0] }.body();
let t = Vec3::new(1.0e5, -1.0e5 * 0.7, 1.0e5 * 0.3);
let mv = |x: &Body| transform(x, t, Vec3::ZERO, Vec3::Z, 0.0).expect("translate");
let (va, vb) = (vol(&a), vol(&b));
let here = run(&a, &b, BoolOp::Union).unwrap();
assert!(close(here, va + vb, va + vb), "{here}");
let there = run(&mv(&a), &mv(&b), BoolOp::Union).unwrap();
assert!(close(there, here, va + vb), "{there} moved, {here} at the origin");
}
/// Two crossing cylinders: the union moved 1000 mm away loses about a tenth of its volume.
#[test]
#[ignore = "kernel bug, #1649"]