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 fieldName. Hint: pass either { file } or { code }, plus { fieldName, point: [x,y,z] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Inline kernelCAD script source. | |
| file | No | Path to a .kcad.ts script file. | |
| point | Yes | Sample point [x, y, z] in mm. | |
| fieldName | Yes | sdf.bind binding name holding the SdfField. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| aabb | No | Axis-aligned bounding box of the field (success). | |
| hint | No | ||
| kind | No | SDF field kind (success). | |
| error | No | ||
| inside | No | Whether the point is inside the surface (success). | |
| distance | No | Signed distance in mm; negative = inside (success). | |
| errorCode | No |