Evaluate SDF
evaluate_sdfUse this when you need to sample a signed-distance field at a point. Sample the signed distance from an in-script sdf.* field at a 3D point. Returns { distance, inside, aabb, kind }. Distance is in mm; negative = inside the surface, 0 = exactly on the surface, positive = outside. Use this to verify SDF composition before calling sdf.materialize (which is the expensive step). The script must bind the SdfField via sdf.bind('', field) and pass that name as field_name. Hint: pass either { file } or { code }, plus { field_name, point: [x,y,z] }.
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": {
"field_name": "<field_name>",
"point": "<point>"
},
"name": "evaluate_sdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Inline kernelCAD script source. | |
| file | No | Path to a .kcad.ts script file. Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files. | |
| point | Yes | Sample point [x, y, z] in mm. | |
| field_name | Yes | sdf.bind binding name holding the SdfField. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||