zudo-stl-fix
GitHub repository

Type to search...

to open search from anywhere

CLI

Using the stl_doctor.py command-line engine directly.

engine/stl_doctor.py is the geometry engine behind the app, and it still works as a standalone command-line tool. It checks STL meshes and, in repair mode, conservatively repairs folded, exactly planar patches.

The CLI is not the app's save path

The CLI creates its outputs as new files, refuses paths that are links to an input or output, and compares the bytes read back (see alias protection). It is still not the transactional, no-overwrite save the app performs, and the CLI's human-readable stdout is not an API. The app talks to the engine through a structured worker protocol instead.

Setup

Python 3.10+ and the packages in engine/requirements.txt (numpy, scipy, trimesh, shapely) are required. From the repository root:

python -m pip install -r engine/requirements.txt
python engine/stl_doctor.py --help

Quick examples

Check one STL, and write the JSON report to a path of your choice:

python engine/stl_doctor.py check fixtures/originals/bar-30hp.stl --report out/check-report.json

Check every .stl file directly inside a directory (not recursive):

python engine/stl_doctor.py check fixtures/originals --report out/all-report.json

Repair a file that has invalid triangle pairs. The repaired copy is written to repaired/nuts-v2-40hp-double-fixed.stl by default:

python engine/stl_doctor.py repair fixtures/originals/nuts-v2-40hp-double.stl

Info

Per the engine contract, both original nuts-v2-*-double.stl fixtures contain 62 invalid triangle-pair interactions, and the other nine originals have no mesh failures under the performed checks. A healthy input in repair mode creates no -fixed copy; it is reported as UNCHANGED.

What the CLI will not do

The CLI never overwrites an input STL, never scales, rotates or translates geometry, and never fills holes, smooths, or voxelizes. Existing-edge cleanup happens only when you pass a positive --weld-tolerance. See the engine contract for the exact scope.

Pages

Revision History

Takeshi TakatsudoCreated: 2026-10-16T13:18:06+09:00Updated: 2026-11-08T00:43:10+09:00