mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 10:35:58 +00:00
Tests: freezing rebuilt arc borders gets its rebuild from a notch across the arc
freezing_rebuilt_arc_borders_keeps_authored_dimension_entity_indices needs the projected border of the sketch's face to come back with a different number of curves. Truck split the sector's arc into pieces that changed with its sweep (270 to 300 degrees); SMLib keeps one arc whatever the sweep, so the count stayed 3. A notch, clear of the sector until a parameter moves it across the arc at 90 degrees, now splits the arc border into two arcs and the notch's sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -353,6 +353,10 @@ fn freezing_rebuilt_arc_borders_keeps_authored_dimension_entity_indices() {
|
||||
run(&mut s, "sketch.line", json!({"points":[format!("{arc}.end"),format!("{arc}.start")],"infer":false}));
|
||||
run(&mut s, "sketch.finish", json!({}));
|
||||
run(&mut s, "solid.extrude", json!({"sketch":profile,"distance":10,"operation":"new","body_name":"Sector"}));
|
||||
// A notch clear of the sector until `notch` moves it across the arc at 90°: then the top face's
|
||||
// arc border is rebuilt in two arcs and the notch's sides.
|
||||
run(&mut s, "parameters.add", json!({"name":"notch","expression":"30 mm"}));
|
||||
run(&mut s, "solid.box", json!({"corner":["-1 mm","notch","-1 mm"],"length":2,"width":2,"height":12,"operation":"cut","targets":["Sector"]}));
|
||||
let pick = top_pick(&s, "Sector");
|
||||
let id = run(&mut s, "sketch.create", json!({"plane":pick}))["sketch"].as_u64().unwrap();
|
||||
let circle = run(&mut s, "sketch.circle.center", json!({"center":[20,20],"radius":2}))["curves"][0].as_str().unwrap().to_owned();
|
||||
@@ -360,7 +364,8 @@ fn freezing_rebuilt_arc_borders_keeps_authored_dimension_entity_indices() {
|
||||
run(&mut s, "sketch.finish", json!({}));
|
||||
let before_count = s.model.state().sketch(id).unwrap().sketch.curves.len();
|
||||
run(&mut s, "parameters.change", json!({"name":"turn","expression":"300 deg"}));
|
||||
assert!(s.model.result(id).unwrap().error.is_none());
|
||||
run(&mut s, "parameters.change", json!({"name":"notch","expression":"9 mm"}));
|
||||
assert!(s.model.result(id).unwrap().error.is_none(), "{:?}", s.model.result(id).unwrap().error);
|
||||
let visible = s.model.state().sketch(id).unwrap().sketch.clone();
|
||||
assert_ne!(visible.curves.len(), before_count, "fixture must rebuild projected topology");
|
||||
let mut pick = top_pick(&s, "Sector");
|
||||
|
||||
Reference in New Issue
Block a user