snapshot --camera and saved views; grid: false / axes: false for headless renders (#1313)
solidcraft-cli snapshot takes --camera JSON and --view with a saved view name (through view.apply, as the MCP screenshot does), plus --no-grid and --no-axes; the MCP screenshot and ui.render take grid/axes, the headless render skips a hidden origin axis, and the app's ui.render follows the Grid and Origin switches. Closes #1245.
This commit is contained in:
1 parent
d824d36821
commit
b3df2c382b
10 files changed
+569
-54
No files matched your search
@@ -118,6 +118,15 @@ A script is a list of commands:
|
||||
|
||||

|
||||
|
||||
`snapshot` looks at the model from the iso view. `--view NAME` takes another standard view (`front`, `back`, `top`, `bottom`, `left`, `right`) or the name of a view saved in the design with `view.save`. `--camera JSON` takes any camera, as the MCP `screenshot` tool does (its conventions are in [the MCP page](mcp.md#camera-and-close-up-recipe)). A script that applies a view itself with `view.apply` sets the camera too. The ground grid lies on Z 0, so it cuts through a part that straddles it: `--no-grid` leaves it out of the picture, and `--no-axes` the origin's axes.
|
||||
|
||||
```sh
|
||||
solidcraft-cli snapshot part.solidcraft --out photo.png --view Photo
|
||||
solidcraft-cli snapshot part.solidcraft --out close-up.png --no-grid --no-axes --camera '{"target": [30, -20, 0], "yaw": 0.6, "pitch": 0.25, "distance": 60}'
|
||||
```
|
||||
|
||||
Windows PowerShell 5.1 drops the double quotes inside an argument it passes to a program: write them as `\"` there.
|
||||
|
||||
A command that fails stops the script. A feature can also fail later, when a parameter change
|
||||
rebuilds it; `run` then exits with status 1, lists the failing features and writes none of
|
||||
its `--out` and `--save` files, because the bodies lack what those features should have made.
|
||||
|
||||
Reference in new issue
Block a user