Make a turning Zpup SVG
render_spinTurn a JSON 3D scene into an SVG animation that rotates around one axis, viewable in an tag or README without JavaScript, plus PNG stills to preview each step.
Instructions
Makes an SVG that turns the scene forever about one axis, with no JavaScript in the file, so it plays inside an tag or a README. Returns PNG stills at even steps of the turn, so you can see what the animation shows. These files are large (tens to hundreds of KB), so pass save_to; the SVG text comes back only when it is small. 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_spin"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| axis | No | Which view angle turns. Default "y", a turntable. | |
| 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. | |
| 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 to write the file to. | |
| duration | No | Seconds for one full turn. Default 8. | |
| direction | No | ||
| keyframes | No | Angles computed exactly, 4 to 720. More is smoother and larger. Default 36. | |
| preview_size | No | Longer side of the PNG in pixels. Default 512. | |
| preview_frames | No | How many stills to send back, at even steps of the turn. Default 4 (0, 90, 180 and 270 degrees). Their default size is 256. |