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:
1 parent
08b6a8fe0f
commit
ec8e739aad
17 files changed
+755
-6
No files matched your search
@@ -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.
|
||||
|
||||
|
||||
+4
-2
@@ -1,6 +1,6 @@
|
||||
# Features
|
||||
|
||||
SolidCraft's commands by area, generated by `cargo xtask features` from the command registry (`solidcraft-cli commands`). **345 commands.** Planned (registered, not built yet): 6. Every command runs the same way from the toolbar, a script, `solidcraft-cli exec <id> '<json>'`, the control channel and MCP; parameters are in the [command reference](book/src/reference/commands.md) (`cargo xtask book`). Status and plans: [ROADMAP](../ROADMAP.md).
|
||||
SolidCraft's commands by area, generated by `cargo xtask features` from the command registry (`solidcraft-cli commands`). **347 commands.** Planned (registered, not built yet): 6. Every command runs the same way from the toolbar, a script, `solidcraft-cli exec <id> '<json>'`, the control channel and MCP; parameters are in the [command reference](book/src/reference/commands.md) (`cargo xtask book`). Status and plans: [ROADMAP](../ROADMAP.md).
|
||||
|
||||
## Sketch (99)
|
||||
|
||||
@@ -270,7 +270,7 @@ SolidCraft's commands by area, generated by `cargo xtask features` from the comm
|
||||
| Configuration Rule | `config.rule` | – |
|
||||
| Configuration Rules | `config.rules` | – |
|
||||
|
||||
## Timeline (19)
|
||||
## Timeline (21)
|
||||
|
||||
| Command | Id | Toolbar |
|
||||
|---|---|---|
|
||||
@@ -293,6 +293,8 @@ SolidCraft's commands by area, generated by `cargo xtask features` from the comm
|
||||
| Inspect Feature | `timeline.inspect` | – |
|
||||
| Copy Features | `timeline.copy` | – |
|
||||
| Paste Features | `timeline.paste` | – |
|
||||
| Add Recorded Feature | `timeline.add` | – |
|
||||
| Export Command Script | `timeline.export_script` | – |
|
||||
|
||||
## Inspect (12, 1 planned)
|
||||
|
||||
|
||||
Reference in new issue
Block a user