preview_gcode
Render sliced G-code as layer or profile images to verify what will actually print. Use profile view to spot floating parts or empty height bands before trusting slice statistics.
Instructions
Draw a picture of sliced G-code, to check what will really be printed before trusting the statistics.
Use view=profile after slice_model: it shows at a glance if parts of the print float or whole stretches of the height are empty. Use view=layer to inspect one layer's perimeters, infill and supports.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"gcode_path": "<gcode_path>"
},
"name": "preview_gcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Picture width and height in pixels | |
| view | No | layer (default): one layer's toolpaths coloured by feature, with the layer below as a faint ghost. profile: front and side silhouettes of everything printed, where a stretch of height with nothing printed shows as a blank band. | layer |
| layer | No | Layer number for view=layer, from 1 (the first layer); default the middle layer | |
| gcode_path | Yes | Absolute path to a text G-code file, such as the gcode_path slice_model returns |