mechlib
Source ↗Parametric mechanical components for Python. Every part below is a function that returns a watertight, FDM-printable mesh in millimetres. Spin it, retune it live, copy the import.
Install
pip3 install git+https://github.com/m-esm/mechlib
Use
import mechlib as ml
body = ml.rbox((40, 24, 12), r=3) # rounded block
body = ml.sub(body, ml.teardrop(4.1, 50, axis="x", up=(0, 0, 1))) # print-safe bore
ml.export_stl(body, "bracket.stl") # watertight gate
Versionloading
Parts–
Unitsmm
Contractexplicit args only · no hidden globals · no project imports
Utility API
Non-visual CSG, probing, fitting, and selection helpers. These have no geometry to show; call them on meshes you already have.