u/HiddenEclipse121

2STEP Converter, formerly STL2STP - Free, open-source to STEP converter
▲ 710 r/3D2A+3 crossposts

2STEP Converter, formerly STL2STP - Free, open-source to STEP converter

I renamed my STLtoSTP script to 2STEP-Converter - and added support for 3MF, OBJ, AMF and IGES while I was at it.

A while back I posted a small script called STLtoSTP that batch-converted STL files to proper STEP solids using OpenCASCADE - the same engine FreeCAD uses internally.

Original post: https://www.reddit.com/r/3Dprinting/comments/1t34y2z/free_batch_stl_to_stp_converter_python/

The key difference from online converters was geometry quality: instead of just wrapping the triangle mesh into a STEP container, it actually sews the mesh into a solid, repairs it, and merges co-planar faces back into real flat surfaces.

People liked it, but the requests were always the same - "can it do 3MF?", "what about OBJ?". So I added them. Then AMF. Then IGES. At that point calling it STLtoSTP made no sense, so I renamed it.

The new name is 2STEP-Converter and it has a deliberate double meaning. It reads as "to STEP" - because whatever you throw at it, you always get a clean STEP file out. It also means "two steps" - because that is literally all it takes to use it: drop your files in the folder, double-click the bat. Done.

Supported formats

Input: .stl .3mf .obj .amf .igs .iges

Output: .stp

How it works under the hood

It replicates the FreeCAD Part workbench pipeline exactly:

  1. Read the mesh
  2. Sew triangles into a watertight solid
  3. Repair invalid geometry
  4. Merge co-planar faces - this is what makes it actually useful, triangulated flat surfaces become real faces
  5. Export STEP AP203

Setup

No manual installation. On first run the bat downloads micromamba and sets up a Python environment with pythonocc-core automatically. About 6 GB on disk, internet needed once. After that it runs fully offline.

Works in batch mode (drop everything in the models\ folder and run) or single file mode from the command line. Tolerance is configurable if you have coarse meshes that fail to sew.

Tested on Windows 11, output verified in Plasticity.

GitHub: https://github.com/yaneony/2STEP-Converter

In case you would like to thank me: https://ko-fi.com/yaneony

u/HiddenEclipse121 — 3 days ago