STL to BREP: A FreeCAD Tool for AI Agents
Description and use
The convert_mesh_to_brep tool in FreeCAD MCP converts STL meshes into valid BREP solids with analytic surfaces, reducing flat faces from 808 to 31 and keeping volume change under 0.04 %.
Problem
Automatic stitching of STL into BREP solids is missing for AI agents working with CAD.
Outcome
The tool converts STL meshes to valid BREP solids with analytic planes and cylinders, reducing faceting from 808 to 31 faces and maintaining volume within 0.04%.
Workflow
- Load STL into FreeCAD MCP
- Run convert_mesh_to_brep with repair=true and default tolerances
- Obtain BREP solid and JSON report
- Verify closed solid, volume change, and residual faceting
Evidence
Automatic stitching of STL into BREP solids.
808 faces, every one of them a plane. The solid is valid, but the holes and the lug are made of narrow flat strips, not cylindrical surfaces.
31 faces: 21 Plane and 10 Cylinder. The surface types are read from the BREP itself; the orange color is applied for the figure only.
All six results are closed, valid solids, and they survived a save-and-reopen test.
The volume change on every part is under 0.04%.
I would like to find STL files that break this tool: cylinders left faceted, wrongly recognized surfaces, distorted holes, extra geometry, or a mesh it cannot process at all.
- Record date: 2026-11-02T05:59:14.913Z