-
Write a script. No imports needed — build123d primitives,
show_object, and agentcad edit helpers are pre-injected by default.
show_object(result) is required.
-
Dry-run first to check metrics without consuming a version:
agentcad run script.py --output test --dry-run
Check volume, dimensions, is_valid in the response.
-
Run for real. Visual feedback is on by default:
agentcad run script.py --output label
Every successful run produces (paths in the JSON response):
preview.png — 4-view composite (front, right, top, iso). Read this
to confirm the part looks right before iterating. One image, all 4 angles.
diff.side_by_side — side-by-side PNG vs the most recent successful prior
version. Read this when iterating to see what your change did.
diff.overlay — tinted (green prev, red this) overlay for subtle shifts.
Read only if side-by-side didn't resolve the question.
viewer.html — interactive 3D viewer for the user (humans only; you can't
render HTML). Mention it to the user so they open it.
Pass --no-preview only for tight parametric sweeps where latency matters.
-
Show the user. After a successful build, open the interactive viewer:
agentcad view v1_label/viewer.html
Users expect to see the result in a browser. Do this every run, unprompted.
-
Inspect if invalid. If is_valid: false or geometry looks wrong:
agentcad inspect v1_label/output.step
-
Measure feature sizes. For dimensions beyond top-level metrics:
agentcad measure v1_label/output.step
Use this for hole diameters, cylindrical boss diameters, edge lengths,
face areas, and full per-feature measurements with --features.
-
Check explicit feature requirements. If the prompt names measurable
holes, bores, or cylindrical bosses, write them into spec.json before
final handoff:
{"features":[{"name":"bolt_holes","type":"cylinder","diameter_mm":6,"count":4}]}
Then run:
agentcad check-spec v1_label/output.step spec.json
Revise the CAD if passed is false. status: success only means the
comparison ran; passed is the actual spec-check result. If you include
axis, copy it from agentcad measure's cylindrical_features[].axis.
-
Iterate. Fix the script, run with a new --output label. Use
agentcad diff 1 2 to compare versions.