Skip to main content

Worm gears for build123d, with DIN-3975 engineering analysis

Project description

Wormgear

Worm gears for build123d, with real DIN-3975 engineering behind the geometry.

PyPI version License: MIT

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 over a generic gear library

Worm gears are the part of the gear ecosystem that nobody else implements properly. bd_warehouse.gear has spur and helical gears but no worm primitives. gggears is excellent for general gears but doesn't do worm threading.

Wormgear:

  • 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-geometry design.json -o out/
wormgear-geometry design.json --profile ZK --globoid --worm-bore 8

See wormgear-geometry --help for the full set of options.

Related libraries

Wormgear is one library in a coherent build123d gear ecosystem:

  • bd_warehouse — spur gears, helical gears, fasteners, bearings
  • gggears — general gear library with rich profiles

Use them together: spur gears from bd_warehouse for parallel-shaft stages, wormgear for perpendicular reduction stages.

Documentation

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wormgear-0.1.0.tar.gz (202.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wormgear-0.1.0-py3-none-any.whl (141.5 kB view details)

Uploaded Python 3

File details

Details for the file wormgear-0.1.0.tar.gz.

File metadata

  • Download URL: wormgear-0.1.0.tar.gz
  • Upload date:
  • Size: 202.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wormgear-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c0cff8e7a20b9884290dd02ba98940f765ecd8275707b0811aa3b9856981fd6
MD5 46d80913a5750073b6665c90434fe6ce
BLAKE2b-256 6dcff7cc3a72a2a0f5a3b1bacc5774f6d233581f3b6155b0b4ae481874fcdd4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for wormgear-0.1.0.tar.gz:

Publisher: publish.yml on pzfreo/wormgear

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wormgear-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wormgear-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 141.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wormgear-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81eed3611843dc702fe2d0539caee80d46553baf3557734c36a94b82ecc42950
MD5 f162f9f1f4ec28cb411bf56d65117cfc
BLAKE2b-256 d98a79055bd7611a5b8259d4fd943253488e6ffeb4f0afb8f603a92b29df73a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for wormgear-0.1.0-py3-none-any.whl:

Publisher: publish.yml on pzfreo/wormgear

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page