Export a design's timeline as a replayable command script (#1045)

timeline.export_script (and solidcraft-cli script) writes a design's history as a command script that solidcraft-cli eval replays into the same design, so a bug that only shows on one design becomes a one-file repro. timeline.add restores one stored feature with its id, names and references, through the same checks a design file gets when it opens.

Closes #886. SychPL's #1078 approached the same issue independently; thanks to both.

Co-authored-by: SychPL <[email protected]>
This commit is contained in:
Lasse LianandSychPL authored and GitHub committed 2026-10-14 09:06:24 -04:00
1 parent 08b6a8fe0f
commit ec8e739aad
17 files changed
+755 -6

No files matched your search

+17
View File
@@ -121,6 +121,23 @@ rebuilds it; `run` then exits with status 1, lists the failing features and writ
its `--out` and `--save` files, because the bodies lack what those features should have made.
`--allow-errors` writes them anyway.
A design's history turns into a script that rebuilds it, which makes a bug that only shows
on one design a one-file reproduction:
```sh
cargo run --release -p solidcraft-cli -- script part.solidcraft --out repro.json
cargo run --release -p solidcraft-cli -- eval repro.json # the same part
```
The script starts with the user parameters (`parameters.add`) and the design's units, sheet
metal and plastic rules and materials, then adds each timeline feature with `timeline.add`,
exactly as the design file holds it: same ids, names and parameter names, so later steps
still find the sketches and bodies they use, and a feature that failed in the design fails
the same way. Edit a step's values to try a change, or delete the steps after a feature to
see the design as it was there. Appearances, folders, named views and configurations are
left out (the CLI notes which), and designs with components or joints are not supported
yet. In the app and over MCP the same script comes from `timeline.export_script`.
Units are millimetres and degrees unless an expression says otherwise (`"1 in"`, `"30 deg"`),
and Z is up.