STL to editable OpenSCAD and CadQuery code

Have an STL of a printer part and want to change one hole size? mesh2cad can export the recovered model as OpenSCAD or CadQuery source, with dimensions as named values, so you edit a number instead of sculpting a mesh.

Quickstart

pip install mesh2cad
mesh2cad convert part.stl -o part.step

Run mesh2cad convert --help for the CadQuery and OpenSCAD export options. To use it from an MCP client, add the server command mesh2cad mcp (install with pip install "mesh2cad[mcp]").

The generated code is rebuilt and compared with the original mesh before it is written. Parts that do not reproduce within tolerance are refused with a reason.

Limits


mesh2cad is free and open source (see the GitHub repository for the license). Found an STL it handles badly? Open an issue with the file.