mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 02:25:55 +00:00
Kernel tests: rustfmt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKQ2rEZvcXNQnhE3Sgs
This commit is contained in:
@@ -328,10 +328,8 @@ mod tests {
|
||||
};
|
||||
// 1 + k t − d (1 − t/δ) = 0.
|
||||
let crossing = (d - 1.0) / (k + d / delta);
|
||||
let removed: f64 = [(0.0, crossing), (crossing, delta)]
|
||||
.iter()
|
||||
.map(|&(a, b)| (b - a) / 6.0 * (area(a) + 4.0 * area(0.5 * (a + b)) + area(b)))
|
||||
.sum();
|
||||
let removed: f64 =
|
||||
[(0.0, crossing), (crossing, delta)].iter().map(|&(a, b)| (b - a) / 6.0 * (area(a) + 4.0 * area(0.5 * (a + b)) + area(b))).sum();
|
||||
assert!((removed - 375.673069).abs() < 1e-6, "{removed}");
|
||||
let before = crate::measure(&basin).unwrap().volume;
|
||||
assert!((before - 140333.333333).abs() < 1e-5, "{before}");
|
||||
|
||||
@@ -1109,8 +1109,7 @@ fn sloped_basin(margin: f64) -> Body {
|
||||
let rectangle = |x0, y0, x1, y1| Loop2::polygon(&[Vec2::new(x0, y0), Vec2::new(x1, y0), Vec2::new(x1, y1), Vec2::new(x0, y1)]);
|
||||
let slab = box_solid(Vec3::ZERO, Vec3::new(100.0, 60.0, 30.0)).unwrap();
|
||||
let pocket =
|
||||
loft(&[(Plane::XY.offset(30.0), rectangle(20.0, margin, 80.0, 50.0)), (Plane::XY.offset(10.0), rectangle(30.0, 20.0, 70.0, 40.0))])
|
||||
.unwrap();
|
||||
loft(&[(Plane::XY.offset(30.0), rectangle(20.0, margin, 80.0, 50.0)), (Plane::XY.offset(10.0), rectangle(30.0, 20.0, 70.0, 40.0))]).unwrap();
|
||||
boolean(&slab, &pocket, BoolOp::Cut).unwrap().unwrap()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user