Wave 333/509: Tests: the cap whose loops prism_measure compares is found by its plane, not as the last face (and 3 more)

4 commits, squashed; the originals stay reachable from tag archive/merge-main-develop.

- 6a780de5f jyviko: Tests: the helical groove's removed volume from the cut's exact volume, not a 0.01 mm mesh's
- 80b7ce28e jyviko: Tests: volume checks held to what their measures can tell, not tighter
- a3e42e548 jyviko: Tests: the cap whose loops prism_measure compares is found by its plane, not as the last face
- fad9c44da jyviko: kernel: measure integrates to SMLib's finest accuracy, 1e-8, not 1e-4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
This commit is contained in:
jyviko
2026-10-29 00:19:42 -04:00
parent 7919eaf44c
commit d2bb84d6fb
5 changed files with 25 additions and 10 deletions
+3 -1
View File
@@ -18,7 +18,9 @@ fn faceted_cut_of_a_helical_groove() {
let section = [Vec2::new(1.2, -0.06), Vec2::new(1.6, -0.06), Vec2::new(1.6, 0.06), Vec2::new(1.2, 0.06)];
let groove = sweep_helix_mesh(&plane, &section, base, k, p, 5.0, 48).unwrap();
let cut = faceted_boolean(&shaft, &groove, BoolOp::Cut, 1e-3).unwrap().unwrap();
let m = cut.mesh(&crate::MeshTolerance::chord(0.01)).unwrap().measure();
// The cut's own volume (SMLib's, of its exact faces): a mesh's at 0.01 mm sags inside the
// shaft's round wall by 0.18 mm³, five times the 3 % the groove is held to.
let m = crate::measure(&cut).unwrap();
// In the shaft from z = 0: the section (r 1.2…1.5, 0.12 tall) for 4 turns, plus the part of
// the first turn's section above z = 0 (its z range is ±0.06 about the turn's height).
let per_turn = 2.0 * PI * 0.12 * (1.5f64.powi(2) - 1.2f64.powi(2)) / 2.0;