STEP: open/insert/drag-drop

Import base feature (FeatureKind::Import, timeline type BaseFeature) holding
the STEP text and the file's product tree; bodies named from the file.
doc.open accepts .step/.stp (any case) as a new design; Insert STEP
(FusionImportCommandFromToolbar) adds one to the current design; File menu,
SOLID > INSERT, drag-and-drop (insert into a non-empty design, else open),
'solvecraft part.step', MCP open. Features (fillet, hole, sketch-on-face
cut, shell) work on imported bodies. Imports are cached so a file is read
once per command. Measure tightens its chord tolerance for small radii.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-07 21:01:04 +00:00
1 parent ed611ed7ba
commit f3dbb12b23
18 files changed
+360 -18

No files matched your search

+4
View File
@@ -158,6 +158,10 @@ fn agent_builds_box_fillet_hole() {
assert_eq!(tool(&mut s, "measure", json!({}))["body_count"], 0);
tool(&mut s, "open", json!({"path": design.to_string_lossy()}));
assert!(rel(volume(&mut s), expect) < 5e-4);
// A STEP file opens as a new design with the same body.
let r = tool(&mut s, "open", json!({"path": step.to_string_lossy()}));
assert_eq!(r["features"], 1, "{r}");
assert!(rel(volume(&mut s), expect) < 5e-4);
let _ = std::fs::remove_dir_all(&dir);
}
+4 -2
View File
@@ -190,8 +190,10 @@ pub fn tool_definitions() -> Vec<Value> {
tool(
"open",
"Open a design",
"Open a .solvecraft design file (replaces the current design).",
obj(json!({"path": string("Path to a .solvecraft file")}), &["path"]),
"Open a .solvecraft design file, or a STEP file (.step/.stp: a new design whose bodies come from the file, as an \
Import base feature; insert into the current design with the FusionImportCommandFromToolbar command). Replaces \
the current design.",
obj(json!({"path": string("Path to a .solvecraft or .step/.stp file")}), &["path"]),
false,
true,
),