Fillet dialog: middle radii for variable fillets (add, remove, position and radius) and the Smooth toggle
Variable type shows a Mid Radius row per point (position along the edge from the start end, 0.01 to 0.99, and a radius expression, with a remove button), an Add Mid Radius button and, with points present, Smooth. They go to solid.fillet as mid and smooth and come back on Edit Feature. Test: the round trip and removing every point. Refs #9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT
This commit is contained in:
1 parent
be18bd6573
commit
62746045af
2 files changed
+84
-1
No files matched your search
@@ -261,6 +261,30 @@ fn variable_fillet_round_trip() {
|
||||
assert_eq!(e.extra.get("radius2"), Some(&json!("4 mm")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn variable_fillet_mid_radii_round_trip() {
|
||||
let mut app = boxed();
|
||||
let e0 = edge(&app, Vec3::new(40.0, 15.0, 20.0));
|
||||
let mut d = start(&mut app, vec![e0], "solid.fillet");
|
||||
d.inputs[0].items.truncate(1);
|
||||
d.extra.insert("type".into(), json!("variable"));
|
||||
d.extra.insert("radius2".into(), json!("2 mm"));
|
||||
d.extra.insert("mid".into(), json!([[0.5, "4 mm"]]));
|
||||
d.extra.insert("smooth".into(), json!(true));
|
||||
let p = apply_commands(&app, &d).unwrap().remove(0).1;
|
||||
assert_eq!((p["mid"].clone(), p["smooth"].clone()), (json!([[0.5, "4 mm"]]), json!(true)), "{p}");
|
||||
let id = apply(&mut app, &d);
|
||||
let e = crate::dialogs::for_feature(&app, id, None).unwrap();
|
||||
assert_eq!(e.extra.get("mid"), Some(&json!([[0.5, "4 mm"]])));
|
||||
assert_eq!(e.extra.get("smooth"), Some(&json!(true)));
|
||||
// All middle radii removed: a plain two-radius fillet again.
|
||||
let mut d = e;
|
||||
d.extra.insert("mid".into(), json!([]));
|
||||
let p = apply_commands(&app, &d).unwrap().remove(0).1;
|
||||
// (an edit: the feature's new parameters)
|
||||
assert_eq!(p["params"]["mid"], json!([]), "{p}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn newer_options_reach_their_commands() {
|
||||
let mut app = boxed();
|
||||
|
||||
Reference in new issue
Block a user