forked from 1b-agent/opencadstudio-upstream
test(constraints): a negative distance value validates by its magnitude
#1415 made a dimensional Distance keep a negative value's sign in the parameter while the geometry uses its magnitude (and a zero fold the points together), but left the value-domain test asserting the old refusal. Assert the new reading, and keep the radius refusal covered. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
7490b2bebd
commit
4f12087539
1 file changed
+13
@@ -4140,12 +4140,25 @@ mod tests {
|
||||
Vector3::new(1.0, 0.0, 0.0),
|
||||
)));
|
||||
let refs = [ParametricRef::point(line, 0), ParametricRef::point(line, 1)];
|
||||
// A distance keeps a negative value's sign in the parameter and
|
||||
// measures its magnitude (`d1=-50`); a radius has no such reading.
|
||||
assert!(scene
|
||||
.validate_parametric_constraint(
|
||||
ConstraintKind::Distance,
|
||||
&refs,
|
||||
Some(&DrivingValue::Literal(-1.0)),
|
||||
)
|
||||
.is_ok());
|
||||
let circle = scene.add_entity(EntityType::Circle(acadrust::entities::Circle::from_center_radius(
|
||||
Vector3::new(0.0, 0.0, 0.0),
|
||||
1.0,
|
||||
)));
|
||||
assert!(scene
|
||||
.validate_parametric_constraint(
|
||||
ConstraintKind::Radius,
|
||||
&[ParametricRef::whole(circle)],
|
||||
Some(&DrivingValue::Literal(-1.0)),
|
||||
)
|
||||
.is_err());
|
||||
assert!(scene
|
||||
.validate_parametric_constraint(
|
||||
|
||||
Reference in new issue
Block a user