gcode_check
Simulates material removal on posted G-code outside Fusion to flag rapids into stock, missing feeds, spindle-off moves, and tool mismatches by file and line before machining.
Instructions
Check posted G-code OUTSIDE Fusion before it goes near a machine (Fusion has no stock simulation; checkToolpath is not one). Runs in the MCP server, so Fusion is only needed to read the stock.
paths: .nc files in machining order (pass all files cam_post wrote, e.g. one per tool on Personal
Use). Coordinates are WCS mm. stock_wcs_mm: [xmin, ymin, zmin, xmax, ymax, zmax]; if omitted, the
stock box and the expected tool numbers are read from the Fusion setup (cam_status stock_in_wcs_mm;
setup name, default the last setup). limits_wcs_mm: optional axis envelope, same format.
clearance_mm: rapids below stock top + clearance inside the footprint are warned about.
Simulates material removal on a height map (resolution_mm cells; tool shapes from the post's tool
comments) and reports problems by file and line: RAPID_INTO_STOCK, FEED_MISSING, SPINDLE_OFF,
NO_TOOL, TOOL_UNEXPECTED, H_MISMATCH, ENVELOPE, ARC_RADIUS, NO_END (errors/warnings) and BELOW_STOCK
(info: normal for through holes and profiles). ok=false means do not run the program.
If CAMotics is installed (camotics=true), the same programs are also simulated in CAMotics (about
10 s); camotics and simulation_comparison give both removed volumes side by side, and a
SIM_DISAGREE warning is added if they differ by more than 5 %. CAMotics reports no collisions.
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": {
"paths": "<paths>"
},
"name": "gcode_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | ||
| setup | No | ||
| camotics | No | ||
| clearance_mm | No | ||
| stock_wcs_mm | No | ||
| limits_wcs_mm | No | ||
| resolution_mm | No | ||
| expected_tools | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |