Repair a mesh
repair_mesh
Mends a mesh's welds, doubled and empty triangles and orientation; fills only named holes.
- Needs
- One body picked in 3D, or the one in Edit mode.
- In the editor
- 3D, an imported mesh picked: Repair, under Mesh tools in the Object tab.
- Tools tab
- A form of its inputs, filled from what is picked; Run makes the change, one step to undo.
- Agent and MCP
- The chat's agent and MCP clients call
repair_mesh, each call one step to undo. Over MCP it also takesproject,editorandrequest_id.
What it does
A mesh mended: corners that coincide welded, empty and doubled triangles removed, every triangle turned to face out. An opening stays open unless it is named by its id from Inspect a mesh, so an eye or a neck is never closed silently; crossings are reported, not hidden.
The reply gives the defects before and after and how far the surface moved. With preview, it reports and changes nothing; run again without it to apply, as one step to undo.
Inputs
As the agent and MCP clients send them. One left out takes the default its description gives.
| Input | Type | What it is |
|---|---|---|
| bodyneeded | string | The body's id or its name: an imported mesh, or any body, which becomes an imported mesh once changed. |
| fill_loops | a list of whole number | Openings to close on purpose, by their ids from inspect_mesh. |
| remove_small_components_mm3 | number or null | Removes loose pieces smaller than this volume, in mm³. |
| max_deviation_mm | number | How far the surface may move, in mm; 0.05 when left out. |
| preview | boolean | true to run it and report what it would change, changing nothing; then call again without it to apply. |
Limits
- Refused, changing nothing, if it would make the mesh worse or move it more than the deviation allowed, 0.05 mm by default.
- A changed body becomes an imported mesh of its own, kept in this browser and uploaded with the project's next Save.
Examples
Given: Mask, a hollow mask imported as a mesh, at the origin.
repair_mesh { "body": "Mask", "preview": true }Then: The defects before and after, nothing to mend on a clean mesh, and nothing changed.