Field noteOct 31, 20264 min read1 source

Open-source FreeCAD MCP fork adds convert_mesh_to_brep tool that recovers planes and cylinders from STL

An open-source FreeCAD MCP fork adds `convert_mesh_to_brep`, a tool that attempts to recover analytic planes and cylindrical surfaces from STL meshes rather than merely stitching triangles into a solid.

In one minute

An open-source FreeCAD MCP fork adds convertmeshtobrep, a tool that attempts to recover analytic planes and cylindrical surfaces from STL meshes rather than merely stitching triangles into a solid. Six test parts produced valid closed solids with volume changes below 0.04%, but the author stresses that the results remain preliminary and narrowly tested.

What changed: An open-source FreeCAD MCP fork adds convert_mesh_to_brep, recovering planar and cylindrical BREP surfaces from STL meshes rather than merely stitching triangles.

What happened

Evgeny Khramov describes adding convert_mesh_to_brep to his open-source fork of FreeCAD MCP. The starting point was a practical gap in working with STL files through an AI agent: stitching a mesh into a closed boundary-representation (BREP) solid can still leave a round hole represented by many flat faces. The new tool aims to recover more useful geometry by identifying planes and cylindrical regions in the mesh and replacing faceted regions with analytic BREP surfaces.

The conversion operates on the STL itself. It does not require the original CAD project, known radii or manually selected faces. It also does not recover the part’s modeling history or infer its original nominal dimensions. The pipeline checks the mesh and can optionally repair minor defects, stitches it into a BREP shell and solid, recognizes planes, then searches for full and partial cylinders and arcs. It can make up to four recognition passes over remaining supported regions. It then checks validity, volume and bounding box and reports reconstruction status. The author distinguishes a valid closed solid from successful surface recovery: one does not prove the other.

The first evaluation used six CC BY-SA STL files from micromet’s Pan and Tilt for Standard Servo set. All were processed with repair=true, default tolerances and no manual face or dimension selection. Each result was a closed, valid solid that passed geometry-kernel checks and a save-and-reopen test. Volume change was below 0.04% for every part. For tiltservomount_std.stl, which contains 2,884 triangles, the output had 31 BREP faces: 21 planes and 10 cylindrical surfaces. These are analytic surface types read from the BREP, not merely smoothed-looking mesh faces. The number of cylindrical faces does not correspond one-to-one with holes.

The output is created as a separate Part::Feature; the original mesh remains in the document and the document is not saved automatically. With FreeCAD running with the updated add-on and a working RPC server, an agent can call the tool with a document name, source file path, output name and repair option. The STL path must be accessible on the computer running FreeCAD, though an existing mesh object can be supplied instead. A JSON report, also stored in ConversionReport, includes recognized surfaces, deviations and reasons regions could not be recovered. The code and documentation are publicly available through the source article.

What the archive adds

Our Hi3D release note covers open-source 3D mesh refinement, a related but distinct task. This is a new event: it applies agent-accessible CAD tooling to recovering analytic geometry from STL meshes, rather than refining a mesh with an image-conditioned model.

Trend signal

This weakly supports agent protocols become the interoperability layer: an MCP tool exposes a specific CAD operation to an AI agent through FreeCAD. The evidence is an individual fork and tool, not proof of broad protocol adoption or a mature integration ecosystem.

Why it matters

For teams that need to edit or reuse scanned, exported or otherwise mesh-only parts, a solid made of analytic surfaces can be more useful than a closed shell of thousands of flat faces. The tool demonstrates a concrete boundary for an agent integration: the agent requests a geometry operation, FreeCAD performs it, and the result arrives as a separate object accompanied by a structured report. That is more actionable than asking a model to describe a mesh or generate CAD commands without a geometry check.

The reported results are promising enough to justify a trial on representative parts, not a production reliability claim. A CAD team should compare recovered geometry with known dimensions or reference models and inspect failure cases before using outputs downstream. The article’s request for difficult real-world STL files points to the key next step: expanding evaluation beyond the single set used during development.

Limits and uncertainty

The six test parts all came from one Pan and Tilt servo set, and the author says the tool was developed against them. The reported volume changes do not establish surface accuracy; maximum distance between source mesh and output was not separately measured. The scanner finding no remaining chains it knows how to recognize is not proof of perfect reconstruction. Arbitrary NURBS surfaces, cones and spheres are not yet reconstructed. The source does not establish performance on arbitrary STL files, production reliability, or an agent’s ability to diagnose every failure from the JSON report.

Reader takeaway

convert_mesh_to_brep is an early, testable way to turn some STL facets into editable analytic FreeCAD geometry through an MCP tool. The initial results are concrete, but only six related parts were tested and volume preservation is not a substitute for measuring surface accuracy. Treat it as a candidate for controlled trials, and test it against geometry your team already understands.

Evidence / sources

  1. 1hram.github.io/en/articles/freecad-mcp-mesh-to-brep
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicMcpExplore the mcp topic hub.
  2. 02archiveField NotesOpen the latest editorial analysis.
  3. 03source ledgerSource LedgerInspect the public source evidence graph.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract