mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-06 12:01:10 +00:00
UI tests: a frame member's volume is compared to the accuracy SMLib measures at
a_whole_sketch_section_stays_whole_through_an_edit compared the ring member's volume before and after turning its section 30° to 1e-6. kernel::measure integrates at SMLib's finest relative accuracy, 1e-4 (measure::ACCURACY, the clamp SmApiBrepComputeMassProperties documents): the exact π (20² − 17²) 600 = 209230.07 mm³ came out 209229.86 before and 209230.43 after. The test compares to 1e-4; the filled circle it guards against is 3.6 times the ring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -139,7 +139,11 @@ fn a_whole_sketch_section_stays_whole_through_an_edit() {
|
||||
let c = apply_commands(&app, &e).unwrap();
|
||||
assert!(c[0].1["params"].get("profiles").is_none(), "{}", c[0].1);
|
||||
run_all(&mut app, c);
|
||||
assert!((volume(&mut app) - before).abs() < 1e-6 * before, "still the ring, not the filled circle");
|
||||
// To the accuracy SMLib measures at (1e-4 relative, the finest it takes: kernel
|
||||
// `measure::ACCURACY`); the ring's exact π (20² − 17²) 600 = 209230.07 mm³ came out
|
||||
// 209229.86 before the turn and 209230.43 after it. The filled circle would be 3.6 times it.
|
||||
let after = volume(&mut app);
|
||||
assert!((after - before).abs() < 1e-4 * before, "still the ring, not the filled circle: {after} mm³, {before} before");
|
||||
// Unticked, the section is a built-in profile again.
|
||||
let mut e = edit_dialog(&app, f, None).unwrap();
|
||||
member(&mut e).whole = None;
|
||||
|
||||
Reference in New Issue
Block a user