export_mesh
Export a COMSOL mesh to STL, Nastran, 3MF, PLY, or native files; choose format and selection options, then verify the saved file exists.
Instructions
Export a mesh to a file (STL, Nastran, 3MF, PLY, COMSOL native).
Uses COMSOL's mesh export tool: sets type, optional stlformat
and selection, then calls mesh.export(path). The file is validated
on disk (existence and byte size).
Args:
tag: mesh tag (default "mesh1"; see export_list for tags).
type: stl/stlbin (default), stlascii, nastran,
3mf, plybin, plyascii, nativebin (.mphbin),
nativeascii (.mphtxt), sectionwise. vtu is not
supported by COMSOL 6.4 clientapi.
path: output file path (auto under artifact root when omitted).
component: component tag owning the mesh; when omitted the model-level
mesh(tag) accessor is tried first, then each component.
selection: optional entity numbers to export (e.g. domain numbers).
Omit for the whole mesh.
stl_format: optional "binary"/"text" STL flavour.
model: model name/tag (None = current model).
Example: export_mesh("mesh1", type="stl", path="C:/out/mesh.stl")
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "export_mesh"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | mesh1 | |
| path | No | ||
| type | No | stl | |
| model | No | ||
| component | No | ||
| selection | No | ||
| stl_format | No |