Draw a Zpup scene
render_sceneDraws a JSON-defined 3D scene as SVG or PNG, renders multiple angles, and returns validation errors with fix paths so you can correct shape placement.
Instructions
Draws a small 3D scene as a flat SVG picture and returns a PNG of it to look at, the SVG text, and any warnings. An invalid scene draws nothing and returns every error with its path and how to fix it. Pass views to see the same scene from several angles in one call, which is the quickest way to find a shape that is in the wrong place. views and pose change only this picture: an angle or a pose set with changes stays in the remembered scene. A scene is plain JSON: { width, height, rotate?, children: [...] } with shapes such as dot, path, ellipse, rect, polygon, box, pyramid, cylinder, cone and hemisphere placed with translate and rotate (degrees). x is right, y is down, z is toward the viewer. Call get_reference once before writing a first scene. The server remembers the last valid scene: a later call can leave scene out to draw it again, or pass changes to edit it.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "render_scene"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| svg | No | Whether to send the SVG text back. Default true. Set false while iterating on the look to save space. | |
| pose | No | Changes to draw with but not to keep, in the form of changes: the picture shows the scene in this pose, and the remembered scene stays as it is. Use it with views to check one pose of a sprite sheet large and from several sides before making the sheet. | |
| scene | No | The scene: an object with width, height and children (JSON text of the same is accepted). Call get_reference for the full format. Leave it out to use the scene from the last valid call. | |
| views | No | View angles to draw, each used in place of the scene's own rotate. Omit to draw the scene as written. | |
| changes | No | Edits to the remembered scene (or to scene, when both are passed), applied in order, so that a small fix does not need the whole scene again. Example: [{ "op": "set", "path": "children[2].translate.y", "value": -30 }, { "op": "append", "path": "children", "value": { "type": "dot", "stroke": 8, "color": "#333" } }, { "op": "copy", "path": "#tree", "value": { "id": "tree2", "translate": { "x": 60 }, "scale": 0.7 } }]. After a remove or insert, later items in that list have a different index, so give shapes an id and use "#id" paths. If the result is not valid, nothing is changed. | |
| save_to | No | Absolute path ending in .svg or .png to write the picture to. With several views, -1, -2 and so on are added to the name. | |
| preview_size | No | Longer side of the PNG in pixels. Default 512. |