Tests: rustfmt the board fixture example and the coplanar asserts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-31 09:20:20 -04:00
committed by jyviko
parent 88c7cb6a82
commit 5e348ae2a8
2 changed files with 13 additions and 2 deletions
+5 -1
View File
@@ -65,7 +65,11 @@ mod run {
.enumerate()
.map(|(c, bodies)| ExportProduct {
name: format!("U{c}"),
bodies: bodies.iter().enumerate().map(|(k, b)| ExportBody { name: format!("U{c}_{k}"), body: b, color: Some([0.2, 0.2, 0.2]) }).collect(),
bodies: bodies
.iter()
.enumerate()
.map(|(k, b)| ExportBody { name: format!("U{c}_{k}"), body: b, color: Some([0.2, 0.2, 0.2]) })
.collect(),
children: Vec::new(),
})
.collect();
+8 -1
View File
@@ -1237,7 +1237,14 @@ fn coplanar_curved_booleans() {
// the union adds the parts outside. A cylinder inside but for a flush cap adds nothing.
let b = box_solid(Vec3::ZERO, Vec3::new(40.0, 30.0, 20.0)).unwrap();
let disc = PI * 25.0;
for (z0, z1, inside, outside) in [(0.0, 20.0, 20.0, 0.0), (-5.0, 20.0, 20.0, 5.0), (0.0, 25.0, 20.0, 5.0), (-5.0, 25.0, 20.0, 10.0), (5.0, 20.0, 15.0, 0.0), (5.0, 25.0, 15.0, 5.0)] {
for (z0, z1, inside, outside) in [
(0.0, 20.0, 20.0, 0.0),
(-5.0, 20.0, 20.0, 5.0),
(0.0, 25.0, 20.0, 5.0),
(-5.0, 25.0, 20.0, 10.0),
(5.0, 20.0, 15.0, 0.0),
(5.0, 25.0, 15.0, 5.0),
] {
let c = cylinder(Vec3::new(20.0, 15.0, z0), Vec3::Z, 5.0, z1 - z0).unwrap();
let cut = measure(&boolean(&b, &c, BoolOp::Cut).unwrap().unwrap()).unwrap().volume;
assert!(rel(cut, 24000.0 - disc * inside) < 1e-6, "cut z {z0}..{z1}: {cut}");