Command ids are SolveCraft's own: 173 ids that were another product's internal command ids become dotted, lower-case ids (<area>.<thing>[.<variant>]: solid.extrude, sketch.rectangle.two_point, sheet.flange, joint.drive, ...), in the registry, toolbar, dialogs, shortcuts, palette, control channel, MCP, examples, scenarios and docs
The old ids live only in crates/engine/src/legacy_ids.rs (the legacy migration table): find_command maps them, so old scripts, recipes and control calls keep working, and saved shortcuts, recent and pinned commands are migrated on load (designs store no command ids). Parity maps the observed catalog ids to ours through xtask/data/fusion-ids.tsv. The agent rule now reads: our own dotted id, never another product's. Cargo.toml's repository points at github.com/bherbruck/solvecraft. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
740360d7c3
commit
d10312b7fd
158 files changed
+3611
-3205
No files matched your search
@@ -13,21 +13,21 @@ use crate::*;
|
||||
#[test]
|
||||
fn moved_component_picks_and_frames() {
|
||||
let mut s = Session::default();
|
||||
run(&mut s, "PrimitiveBox", json!({"length": 10, "width": 10, "height": 10, "body_name": "Base"}));
|
||||
let c = run(&mut s, "FusionCreateNewComponentCommand", json!({"name": "Arm"}));
|
||||
run(&mut s, "solid.box", json!({"length": 10, "width": 10, "height": 10, "body_name": "Base"}));
|
||||
let c = run(&mut s, "component.create", json!({"name": "Arm"}));
|
||||
let (cid, occ) = (c["component"].as_u64().unwrap(), c["occurrence"].as_u64().unwrap());
|
||||
run(&mut s, "PrimitiveBox", json!({"corner": [20, 0, 0], "length": 10, "width": 4, "height": 4, "body_name": "ArmBody"}));
|
||||
run(&mut s, "solid.box", json!({"corner": [20, 0, 0], "length": 10, "width": 4, "height": 4, "body_name": "ArmBody"}));
|
||||
run(&mut s, "component.activate", json!({"component": 0}));
|
||||
run(&mut s, "occurrence.move", json!({"occurrence": occ, "translate": [0, 50, 0]}));
|
||||
let wbox = |s: &Session, b: &str| s.world_state().body(b).unwrap().mesh().bounds();
|
||||
let vol = |s: &mut Session, b: &str| run(s, "MeasureCommand", json!({"bodies": [b]}))["total"]["volume_mm3"].as_f64().unwrap();
|
||||
let vol = |s: &mut Session, b: &str| run(s, "inspect.measure", json!({"bodies": [b]}))["total"]["volume_mm3"].as_f64().unwrap();
|
||||
// Root active: a fillet picked at the moved edge in the world.
|
||||
run(&mut s, "FusionFilletEdgesCommand", json!({"edges": [[25, 54, 4]], "radius": 1}));
|
||||
run(&mut s, "solid.fillet", json!({"edges": [[25, 54, 4]], "radius": 1}));
|
||||
assert!(rel(vol(&mut s, "ArmBody"), 160.0 - (1.0 - PI / 4.0) * 10.0) < 1e-4, "{}", vol(&mut s, "ArmBody"));
|
||||
// A sketch on the moved body's top face: its points sit on that face in the world.
|
||||
let sk = run(&mut s, "SketchCreate", json!({"plane": {"face": [25, 52, 4]}}));
|
||||
run(&mut s, "CircleCenterRadius", json!({"center": [0, 0], "radius": 1}));
|
||||
run(&mut s, "SketchStop", json!({}));
|
||||
let sk = run(&mut s, "sketch.create", json!({"plane": {"face": [25, 52, 4]}}));
|
||||
run(&mut s, "sketch.circle.center", json!({"center": [0, 0], "radius": 1}));
|
||||
run(&mut s, "sketch.finish", json!({}));
|
||||
let si = run(&mut s, "sketch.inspect", json!({"sketch": sk["sketch"]}));
|
||||
let z: Vec<f64> = si["points"].as_array().unwrap().iter().map(|p| p["world"][2].as_f64().unwrap()).collect();
|
||||
assert!(z.iter().all(|z| (z - 4.0).abs() < 1e-6), "{si}");
|
||||
@@ -43,6 +43,6 @@ fn moved_component_picks_and_frames() {
|
||||
let inst = names.iter().find(|n| n.starts_with("ArmBody (")).cloned().unwrap();
|
||||
let ib = wbox(&s, &inst);
|
||||
// Its bottom edge along x at the far side (y max, z 0).
|
||||
run(&mut s, "FusionFilletEdgesCommand", json!({"edges": [[25, ib.max.y, 0]], "radius": 1}));
|
||||
run(&mut s, "solid.fillet", json!({"edges": [[25, ib.max.y, 0]], "radius": 1}));
|
||||
assert!(vol(&mut s, "ArmBody") < v0 - 1.0, "the instance's pick reached the definition");
|
||||
}
|
||||
Reference in new issue
Block a user