Fit a body to a mesh
fit_meshTurn a mesh file (STL, OBJ, glTF or GLB, or the tessellated bodies of a STEP AP242 file) into MBEstudio geometry: outline lofts fitted slice by slice, holes as subtracting lofts, and an envelope that is the mesh's bounding box. Without text and owner: { text, report }, where text is the envelope item and the generated body to paste into a part def. With text and owner: the fit written into that part def as one edit (an earlier generated body and the envelope are replaced), { ok, message, text, ops, errors, replacedBody, replacedEnvelope, report }. The report gives the slicing axis, envelope (mm), loft and point counts, and overlap, the mean intersection over union of fitted and true cross sections (1 is perfect).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_base64": "<file_base64>",
"file_name": "<file_name>"
},
"name": "fit_mesh"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| axis | No | The part axis to slice along; auto tries each and keeps the best. | |
| name | No | Loft name prefix (default shell). | |
| text | No | A model to write the fit into, with owner. | |
| holes | No | Keep holes as cuts (default true). | |
| owner | No | The part def (qualified or unique name) that gets the body. | |
| units | No | Units of the file; auto takes a mesh under 3 units across as metres. glTF and AP242 are metres. | |
| format | No | ||
| origin | No | Part origin: the bounding box centre (default), or the mesh's own origin for a mesh already in the part frame. | |
| points | No | Most corners per ring (default 26 or 24). | |
| step_mm | No | Distance between slices (default 2.5 mm under 90 mm across, else 3). | |
| file_name | Yes | The file's name; its extension gives the format unless format is set. | |
| max_points | No | Budget of outline points for the body (default 2000); over it the fit coarsens. | |
| file_base64 | Yes | The mesh file, base64. |