Worm gears for build123d, with DIN-3975 engineering analysis
Project description
Wormgear
Worm gears for build123d, with real DIN-3975 engineering behind the geometry.
from wormgear import WormGear, WormWheel
worm = WormGear(module=2.0, num_starts=1, length=40) # is a build123d Part
wheel = WormWheel(module=2.0, num_teeth=30) # is a build123d Part
worm.export_step("worm.step")
wheel.export_step("wheel.step")
Or for a guaranteed-matched pair in one line:
from wormgear import make_pair
worm, wheel = make_pair(module=2.0, ratio=30, length=40)
That's the whole API for most users. Both classes subclass build123d.BasePartObject, so you can show(), export_step(), or compose them into assemblies directly.
Why use this
Wormgear supplements the excellent build123d gear ecosystem (bd_warehouse for spur gears and other parts, py_gearworks for spur / helical / bevel / cycloid / inside-ring) with specialist support for worm gears, which neither of those libraries currently covers.
What it does:
- Implements real DIN-3975 derivation. Lead angle, pitch diameter, addendum/dedendum, throat radius for globoid worms — all standards-compliant rather than approximate.
- Calculates load-capacity-relevant fields per DIN-3996 (efficiency estimate, self-locking detection, recommended materials).
- Generates exact geometry. No "good enough after manufacturing" approximations — the STEP file is exactly what your CNC will cut or your printer will print.
- Two tooth profiles: ZA (straight flanks, CNC-friendly), ZK (slightly convex, 3D-print-friendly).
Install
pip install wormgear
Requires Python 3.12+. build123d (and its OpenCascade backend) installs automatically.
Beyond the basics
Engineering analysis
from wormgear import make_pair, check_mesh
worm, wheel = make_pair(module=2.0, ratio=30, length=40)
# Kinematic mesh validation (independent of how the gears were built)
report = check_mesh(worm._params, wheel._params, worm._assembly_params)
print(f"ok: {report.ok}, ratio: {report.ratio}, "
f"centre distance: {report.centre_distance_mm:.2f} mm")
For full DIN-3975 design analysis (efficiency, self-locking, undercut, etc.):
from wormgear.calculator import design_from_module, validate_design
design = design_from_module(module=2.0, ratio=30)
result = validate_design(design)
print(f"efficiency: {design.assembly.efficiency_percent:.1f}%, "
f"self-locking: {design.assembly.self_locking}")
for msg in result.warnings:
print(f"warning: {msg.message}")
Features (bores, keyways, set screws)
from wormgear import WormGear
from wormgear.core import BoreFeature, KeywayFeature
worm = WormGear(
module=2.0, num_starts=1, length=40,
bore=BoreFeature(diameter=8.0),
keyway=KeywayFeature(), # auto-sized DIN-6885 keyway
)
Web calculator
Don't want to write any code? wormgear.studio is the browser-based version of the calculator. It produces a JSON file you can load:
from wormgear import WormGear, WormWheel
from wormgear.io import load_design_json
design = load_design_json("my-design.json")
worm = WormGear.from_design(design, length=40)
wheel = WormWheel.from_design(design)
CLI
For shell-driven workflows (CAM pipelines, batch generation):
wormgear design.json -o out/
wormgear design.json --profile ZK --globoid --worm-bore 8
See wormgear --help for the full set of options. (wormgear-geometry is kept as a backwards-compatible alias.)
Advanced: virtual hobbing
For high-precision conjugate contact (e.g. high-load applications or contact-stress analysis), wormgear.advanced.virtual_hobbing kinematically simulates the hobbing manufacturing process — slower than throated=True, but produces sub-tenth-percent-accurate tooth flanks:
from wormgear import WormGear, WormWheel
from wormgear.advanced import virtual_hobbing
worm = WormGear(module=2.0, num_starts=1, length=40)
wheel = WormWheel(module=2.0, num_teeth=30)
precise_wheel = virtual_hobbing(worm, wheel, steps=72)
Most users want plain WormWheel(throated=True) — reach for this when you specifically need kinematic accuracy.
Related libraries
Wormgear is one library in the build123d gear ecosystem:
bd_warehouse— spur gears, fasteners, bearings, threads, sprocketspy_gearworks— spur, helical, bevel, cycloid, and inside-ring gears
Use them together: spur / helical gears from bd_warehouse or py_gearworks for parallel-shaft stages, wormgear for perpendicular reduction stages.
Documentation
- Architecture — system design
- Geometry — technical specification
- Engineering Context — DIN-3975/DIN-3996 background
Background
Created for custom worm gear design in luthier (violin making) applications, where standard gears don't fit unusual envelope constraints. Extended to support CNC machining and 3D printing for makers and engineers.
License
MIT
Author
Paul Fremantle (@pzfreo)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wormgear-0.1.2.tar.gz.
File metadata
- Download URL: wormgear-0.1.2.tar.gz
- Upload date:
- Size: 205.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7371f74d77d89c09d32b942f41c77fafb83b999c107086a8ea4f8b0d9811df00
|
|
| MD5 |
b62827cd90734bb13c93121f4dac8b76
|
|
| BLAKE2b-256 |
5c93106c4df436858a3fea80e91a139fb09508c5a52b25e2caa9e104ba796e81
|
Provenance
The following attestation bundles were made for wormgear-0.1.2.tar.gz:
Publisher:
publish.yml on pzfreo/wormgear
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wormgear-0.1.2.tar.gz -
Subject digest:
7371f74d77d89c09d32b942f41c77fafb83b999c107086a8ea4f8b0d9811df00 - Sigstore transparency entry: 1624661339
- Sigstore integration time:
-
Permalink:
pzfreo/wormgear@69c598205d55f634d1273cfd7ed4ca05afe505cc -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/pzfreo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@69c598205d55f634d1273cfd7ed4ca05afe505cc -
Trigger Event:
release
-
Statement type:
File details
Details for the file wormgear-0.1.2-py3-none-any.whl.
File metadata
- Download URL: wormgear-0.1.2-py3-none-any.whl
- Upload date:
- Size: 143.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29a33e5fe6201b29b3f7a245b35347d4ca0b150b781d8cf55e84456884f9906f
|
|
| MD5 |
6e809b77219f99cb4ee3de5df4308d1d
|
|
| BLAKE2b-256 |
299ea933a075765e7db44f794c206cc1a9785d906ec75c41a10c57e833c5a3b2
|
Provenance
The following attestation bundles were made for wormgear-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on pzfreo/wormgear
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wormgear-0.1.2-py3-none-any.whl -
Subject digest:
29a33e5fe6201b29b3f7a245b35347d4ca0b150b781d8cf55e84456884f9906f - Sigstore transparency entry: 1624661352
- Sigstore integration time:
-
Permalink:
pzfreo/wormgear@69c598205d55f634d1273cfd7ed4ca05afe505cc -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/pzfreo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@69c598205d55f634d1273cfd7ed4ca05afe505cc -
Trigger Event:
release
-
Statement type: