iterate_design
Automatically generates 3D models, validates them for printability, and improves the prompt to fix issues. Repeats until the model passes or maximum attempts are reached.
Instructions
Automated design iteration: generate -> validate -> improve -> regenerate.
Runs a closed loop that generates a model, validates it for
printability issues, and if issues are found, improves the prompt
and regenerates. Stops when the model passes validation or
max_iterations is reached. Returns the best result.
:param prompt: Text description or OpenSCAD code.
:param provider: Generation provider (default ``"openscad"``).
:param max_iterations: Maximum improvement attempts (1-5).
:param material: Optional material for design intelligence.
:param printer_model: Optional printer model for constraints.
:param brief_id: Optional saved-goal id from ``design_session``.
When supplied AND the best iteration produced a mesh, a
``design_brief:<id>`` intent sidecar is written next to
the produced file so the audit's "matches what you
asked for" gate, the brief failure_history wiring, and
the ``compare_design_versions`` intent diff all light
up against the saved goal — without the user having to
re-attach the brief after every iteration round.
Best-effort: kiln-pro not installed silently skips.
:returns: Dict with the best result and iteration history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| brief_id | No | ||
| material | No | ||
| provider | No | openscad | |
| printer_model | No | ||
| max_iterations | No |