export_model
Convert OpenSCAD code or files into STL, 3MF, AMF, OFF, NEF3, DXF, SVG, PDF, or CSG formats, with optional multi-part exports and mesh health validation.
Instructions
Export OpenSCAD code or file to a mesh, 2D, or CSG format. With parts=[{name, code, place?}] every part is exported separately (in its assembly position) and bundled into one 3MF with named objects, or into a directory of STLs when output_format="stl"; a manifest is returned.
Mesh exports (stl, 3mf, amf, off, nef3) also return a "mesh_health" block from OpenSCAD's CGAL statistics: "manifold" is true, false, or null when OpenSCAD did not perform the check. A non-manifold result usually means parts touch along an edge or face; overlap them slightly.
Args: scad_content: OpenSCAD code to export (mutually exclusive with scad_file) scad_file: Path to OpenSCAD file (mutually exclusive with scad_content) output_format: "stl", "3mf", "amf", "off", "nef3" (3D), "dxf", "svg", "pdf" (2D), or "csg" (evaluated CSG tree). Default "stl". output_path: Path to write the exported file. If not specified, a temp directory is used. variables: Variables to pass to OpenSCAD via -D flags include_paths: Additional include paths for OpenSCAD via the OPENSCADPATH environment variable ctx: MCP context for logging
Returns: Dict with success status, output_path, format, file_size_bytes, mesh_health (mesh formats), warnings, errors, and hints
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parts | No | ||
| quality | No | ||
| scad_file | No | ||
| variables | No | ||
| output_path | No | ||
| scad_content | No | ||
| include_paths | No | ||
| output_format | No | stl |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||