counterpart_part_meshes
Counterpart contract (counterpart/1): one STL per printable part of any 3MF (a pass's, counterpart_make_3mf's, cad_run's project_3mf, or a designer's Bambu Studio, OrcaSlicer or plain 3MF), so a client draws each part in its colour or…
Instructions
Counterpart contract (counterpart/1): one STL per printable part of any 3MF (a pass's, counterpart_make_3mf's, cad_run's project_3mf, or a designer's Bambu Studio, OrcaSlicer or plain 3MF), so a client draws each part in its colour or shows the design in AR. Writes into a new folder it creates inside out_dir and never overwrites. Returns units (mm), folder and parts: [{id, name, plate?, color?, filament?, painted?, stl_path, triangles, size_mm}], one per part per printed copy. Every STL is in the 3MF's build frame in millimetres, component and build transforms applied, so the parts line up when drawn together; plate is the plate number from 1 (list_3mf_plates index + 1), absent for a 3MF without plates; color is #RRGGBB from the 3MF's own filament colours, absent when it declares none; painted means slicer painting recolours some facets. A part beyond the read limits is listed in skipped with why.
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": {
"three_mf_path": "<three_mf_path>",
"out_dir": "<out_dir>"
},
"name": "counterpart_part_meshes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out_dir | Yes | An existing folder; each call writes into a new subfolder of it. | |
| three_mf_path | Yes | Path to the 3MF. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parts | Yes | ||
| units | Yes | ||
| folder | Yes | The new folder the STLs were written in. | |
| skipped | No | ||
| contract | Yes |