Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions crates/engine/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5863,9 +5863,11 @@ fn press_pull_on_curved_faces() {
let v1 = volume(&mut s);
assert!(rel(v1 - v0, PI * (25.0 - 16.0) * 20.0) < 1e-3, "{v0} {v1}");
// A shell's inner wall behind a fillet (`F3:inner(F2:blend(…))`) only names the fillet: it is
// offset like any curved face, not taken for the shell's fillet. Pulled 0.5 into the cavity
// (radius 3 to 2.5), the wall alone moves, stepping in from its tangent neighbours: the
// quarter ring between the radii, 18 high, is added.
// an Offset Face, not taken for the shell's fillet. The wall is a round of 3 in the cavity's
// corner, tangent to the inner walls x = 38 and y = 38, its normals pointing at its axis (a
// fillet in a concave edge of the body): pulled 0.5 into the cavity it goes back at
// 3 + 0.5 = 3.5, still tangent to them (solidcraft#23043). The corner's area between the
// walls and the round, (1 - pi/4) r², grows from r = 3 to 3.5, 18 high.
let mut s = Session::default();
run(&mut s, "solid.box", json!({"length": 40, "width": 40, "height": 20}));
run(&mut s, "solid.fillet", json!({"edges": [[40, 40, 10]], "radius": 5}));
Expand All @@ -5874,9 +5876,9 @@ fn press_pull_on_curved_faces() {
let v0 = volume(&mut s);
let out = run(&mut s, "solid.press_pull", json!({"face": [on.x, on.y, on.z], "distance": 0.5}));
assert!(out["name"].as_str().is_some_and(|n| n.starts_with("OffsetFace")) && out.get("edited").is_none(), "{out}");
let ring = PI / 4.0 * (3.0 * 3.0 - 2.5 * 2.5) * 18.0;
let grown = (1.0 - PI / 4.0) * (3.5 * 3.5 - 3.0 * 3.0) * 18.0;
// Each volume to the measure's 2e-7.
assert!((volume(&mut s) - v0 - ring).abs() < 4e-7 * v0, "{} vs {ring}", volume(&mut s) - v0);
assert!((volume(&mut s) - v0 - grown).abs() < 4e-7 * v0, "{} vs {grown}", volume(&mut s) - v0);
}

/// #4986: Press Pull on a chamfer's flat face changes the chamfer's distance, as on a fillet's
Expand Down
Loading
Loading