Tests: curved bodies' contact stop is checked, not the sweep's internal step

ordinary_curved_bodies_keep_a_practical_sampling_step asserted
ContactGeometry.step > 1.0, an internal sampling step derived from the
bodies' display meshes. What a user gets is the drive: it either stops at the
contact or is refused for running out of the sampling budget. The test,
renamed ordinary_curved_bodies_stop_at_their_contact_within_the_sampling_budget,
keeps that: the slide drives to -30 without a budget error and stops in
(-5.02, -4.9) (the sphere r 5 about x = 20 and the box from x = 15 meet the
block's x = 10 side after 5).

It still fails on develop with "motion exceeds contact sweep collision
budget": the planar faces meshed as grids, which the planar-tessellation fix
(#9307) addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-30 06:38:11 -04:00
committed by Irakli Kourtis
parent 51855589d8
commit c1328212d3
+4 -3
View File
@@ -167,8 +167,11 @@ fn thin_tilted_plates_cannot_cross_between_axis_bound_samples() {
assert!(value > -2.0 && value < -1.9, "{value}");
}
/// A slider carrying a sphere or a box with a rounded edge stops where it meets a block 5 mm
/// away (the sphere's and the box's near sides at x = 15, the block's at 10): ordinary curved
/// bodies sweep within the contact sampling budget, however their faces are meshed.
#[test]
fn ordinary_curved_bodies_keep_a_practical_sampling_step() {
fn ordinary_curved_bodies_stop_at_their_contact_within_the_sampling_budget() {
for curved in ["sphere", "fillet"] {
let mut s = Session::default();
run(&mut s, "component.create", json!({"name": "Blocker"}));
@@ -187,8 +190,6 @@ fn ordinary_curved_bodies_keep_a_practical_sampling_step() {
json!({"type": "slider", "a": 0, "b": "Curved", "at": {"occurrence": 0, "point": [0,0,0], "z": [1,0,0]}, "name": "Slide"}),
);
run(&mut s, "contact.create", json!({"occurrences": ["Blocker", "Curved"]}));
let geometry = super::ContactGeometry::new(&s).unwrap();
assert!(geometry.step > 1.0, "{curved}: tessellation must not force tiny steps: {}", geometry.step);
let result = run(&mut s, "joint.drive", json!({"joint": "Slide", "value": -30}));
assert!(result["stopped_by_contact"].is_object(), "{curved}: {result}");
let value = s.doc.assembly.joints.iter().find(|j| j.name == "Slide").unwrap().values[0];