Build and measure a part
evaluate_partBuild a part from a parcad DSL script, or a saved project without sending it, and report what the kernel built. The reply opens with the verdicts: the part's own checks (read checks.verdict first), brief (what the part is for, judged on the build: write brief({ envelope: [x, y, z] }) in the first build), and print_check — loose pieces, thin walls (failed under 0.3 mm, which export_part and save_project refuse without allow_failing), cuts into another feature, overhang. Then size, volume, area, faces, edges, bodies (free-standing pieces: one for a part), voids, stands_on, tags and tag_extents.
Read tag_extents before any picture: it is the only number that says whether a feature is where you meant it, since every other one is unchanged when a feature faces the wrong way. Compare each tag's center with the part's centroid and with the script; a tag in unlocated_tags owns no face of the finished part.
A part in several solids returns named shapes, return { base, lid }: named_bodies measures each alone (pieces above 1 is a body its own booleans split) and between_bodies each pair on the exact solids — clear with clearance_mm, touching with contact_mm2, interfering with depth_mm. Read the depth and the contact, not the verdict. Bodies are never fused; selectors and treatments work inside one body. .reference() marks a body that is not the part, such as the coins it holds: measured against every body, left out of size, volume, the print check and exports. A reply lists at most 6 bodies and 16 pairs, the deepest interference first; named_bodies_unlisted and between_bodies_unlisted count the rest, and bodies: [names] lists those. Checks, motion and mechanisms are written in the script (read_docs dsl Check, TurnCheck, Mechanism): { clear: ["lid", "base"], atLeast: 0.2 } holds at one pose, { turns: { body, about, at, degrees }, clearOf: ["base"], atLeast: 0.3 } over a whole travel. A failed check never stops this tool.
Pass views (iso, front, top, …) to see it too; each view carries scale_mm over scale_px and path, and size is still the number to quote. Pass section: { axis, at_mm } with a view to cut it open: the flat orange is material the plane passed through, anything darker inside it is void, and cut_fraction 0 means the plane missed. To show the user the part, save_project and open_project it.
edits with project builds it with lines changed and nothing saved — 'what if the wall were 1.2 mm' in one call; edit_part is the tool that saves. A build is kept per script, so asking again with views reuses it; timeout_s gives a heavy part longer than 20 s.
A surface (surfaceLoft, trim, patch, …) reports kind: "surface" and surface — area, free_edges, boundary_loops — instead of a volume; .thicken(t) makes it a solid. Curved outlines are drawn, never faked with short straight edges: a section entry { through }, { radius }, { spline }, { fit, tolerance } or { curve: (t) => [x, y], from, to, tolerance }, and spurGearOutline for a gear (read_docs dsl SectionEntry); deviation_mm and curve_bound_mm measure what was built.
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": "evaluate_part"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | List only these tags in `tag_extents`, the cuts into them in `collisions`, and their colours in a `regions` view. | |
| edits | No | Changes to build with, in order, each { old, new } replacing text that appears exactly once. Nothing is written back; edit_part saves. | |
| views | No | Also draw the part from these viewpoints: `iso`, `front`, `back`, `left`, `right`, `top`, `bottom`, all in one framing. The names are absolute, not part-relative — `front` looks along +Y whatever way the part is turned — and each view's `axes` says in one sentence what it looks along and which way is up. | |
| bodies | No | For a part in several bodies, after a reply without it: list only these in `named_bodies` and `print_check.bodies`, and only the pairs with one of them in `between_bodies`, pairs of two of them first. A reply already lists every interference first; name bodies to see what `between_bodies_unlisted` counted. | |
| script | No | A parcad DSL script that returns a shape, `return body.cut(hole)`, or named shapes, `return { base, lid }`. Millimetres; primitives are centred on the origin and placed with `.at(x, y, z)`. Give this or `project`. | |
| project | No | A saved part to build without sending it, as list_projects spells it, or "@session" for the script on the user's screen. | |
| regions | No | Colour each view by the tag that owns the surface instead of shading it, and name every tag's colour and share, `visible: false` for one hidden from that angle. A face takes the tag nearest the node that made it: a tag inside a union, or on a moved or mirrored copy, wins. | |
| section | No | Cut the part open on a plane for the views; the part and every measurement stay whole. | |
| materials | No | Draw each face in its `.material()` colour instead of grey. | |
| timeout_s | No | Seconds the kernel may take, 1 to 600; defaults to 20. A finished build is kept, so asking again does not wait again. A script's own work is raised with `scriptBudget(n)` in the script. | |
| image_size | No | Pixels per side, 128 to 1024. Defaults to 512. |