# 將三維場模型匯出為 STL (`field.exportModelStl`)

[元件參考](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/) · [English](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/commands/field-exportModelStl/)

**選單:** 無（快速開啟、CLI、Python 與 MCP） · **執行方式:** 背景工作，有進度與取消

> 預覽功能：在「編輯 › 偏好設定 › 模擬」開啟預覽功能，或執行 `preview.set {"enabled":true}`。回覆會帶有 `preview: true` 與說明。

以下參數與說明取自指令本身的定義，與 CLI、Python 及 MCP 讀到的文字相同，因此保留英文。

## 說明

Writes the meshed 3D model of the design, sketch or import as STL, so its bodies can be checked in a CAD or mesh viewer or taken on into another tool. Each region's solid is the boundary of its tetrahedra: curved faces come out as the mesh's flat facets, and two regions that touch both have the faces between them, turned opposite ways. A ring design is revolved whole. Solves nothing and changes nothing; save the text with the extension .stl.

## 參數

- `design`: object? or "sketch":object? or "import":object? (the model as magnetics.fieldSolve {dimension: 3} builds it, with "muR","clearanceMm","elementMm","layers","stepDeg","endTurns" and "cache" as there)
- `unit`: "mm|m"="mm" (the file's unit; STL has none of its own)
- `whole`: bool=true (reflect a part meshed for its symmetry (the wound E core's eighth, an extrusion's half or quarter) into the whole model; false writes the meshed part as the solve meshes it)
- `regions`: \[str\]? (the regions to write, by name; default every region, the air box included)

## 回覆

- stl (ASCII STL text, one solid per region named after it, each closed and facing outward)
- unit
- solids:\[{region,facets,vertices,volumeM3}\]
- model:{construction,family,nodes,elements,symmetry,whole (the file is the whole model)}
- notes:\[{en,zh-Hant}\]
