Skip to main content

Cover banner

Beltpy: Geometric Solver and Visualizer for timing belts!

This module provides you with a way to generate realistic profiled belt paths. Currently, GT and HTD profiled belts can be generated, but more profiles might get added in the future. This module can be seen as a 2D expansion to my other project pybeltsolver, which can generate generic 1D belt paths without a profile.

Installation

Install using pip:

pip install beltpy

Examples

The procedure to define a valid path configuration is identical for this module as in pybeltsolver.

Example 1

This example demonstrates a belt system with 3 pulleys, one of which is a tensioner, using the GT2 belt profile

import matplotlib.pyplot as plt
import numpy as np
from pybeltsolver import Belt, BeltFace

from beltpy import BeltSystem, SmoothPulley, ToothedPulley
from beltpy.profiles import GT2

# This example demonstrates a belt system with 3 pulleys, one of which is movable.

profile = GT2

p1 = ToothedPulley(
    teeth=53,
    coords=(0, 0),
    profile=profile,
    name="Pulley 1",
)

p2 = SmoothPulley(
    diameter=23 * 2 / np.pi,
    coords=(50, 8),
    profile=profile,
    name="Idler",
)

p3 = ToothedPulley(
    teeth=20,
    coords=(78.87, 0),
    profile=profile,
    name="Pulley 2",
)

routing = [BeltFace.FRONT, BeltFace.BACK, BeltFace.FRONT]
midline = Belt(circles=[p1, p2, p3], topology=routing, allow_crossing=True)

belt_length = midline.total_length

target_length = belt_length // profile.pitch * profile.pitch
midline.find_movable_circle_position(target_length, 1, np.array([0, 1]))

system = BeltSystem(
    belt=midline,
    profile=profile,
)

fig, ax = system.plot(detailed=False, show=False)

ax.grid()
plt.show()

Example of a generated 3 pulley GT2 belt system

Example 2

This example demonstrates a belt system with 4 pulleys, one of which is a tensioner, using the GT3 profile.

import matplotlib.pyplot as plt
import numpy as np
from pybeltsolver import Belt, BeltFace

from beltpy import BeltSystem, SmoothPulley, ToothedPulley
from beltpy.profiles import GT3

# This example demonstrates a belt system with 4 pulleys, one of which is movable.

profile = GT3

p1 = ToothedPulley(
    teeth=25,
    coords=(0, 0),
    profile=profile,
    name="Pulley 1",
)

p2 = SmoothPulley(
    diameter=23 * 2 / np.pi,
    coords=(50, 8),
    profile=profile,
    name="Idler",
)

p3 = ToothedPulley(
    teeth=20,
    coords=(78.87, 0),
    profile=profile,
    name="Pulley 2",
)
p4 = ToothedPulley(
    teeth=35,
    coords=(30, -29),
    profile=profile,
    name="Pulley 3",
)

routing = [
    BeltFace.FRONT,
    BeltFace.BACK,
    BeltFace.FRONT,
    BeltFace.FRONT,
]
midline = Belt(
    circles=[p1, p2, p3, p4],
    topology=routing,
    allow_crossing=True,
)

belt_length = midline.total_length
target_length = belt_length // profile.pitch * profile.pitch
midline.find_movable_circle_position(
    target_length,
    1,
    np.array([0, 1]),
)

system = BeltSystem(
    belt=midline,
    profile=profile,
)

fig, ax = system.plot(detailed=False, show=False)

ax.grid()
plt.show()

Example of a generated 4 pulley GT3 belt system

How to add your own tooth-profile

The code ships with two example tooth profiles: GT2 and GT3 with a 2 and 3 mm pitch. However, you may add any profile you want, even custom ones, as long as they can be broken down as the figure below suggests:

Tooth profile descriptive diagram

To add a profile, simply follow the GT2 and GT3 examples found in src/beltpy/profiles.py.

Metadata

Release files for beltpy 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beltpy 0.2.1
File Size Uploaded Provenance Actions
beltpy-0.2.1.tar.gz 17.6 kB Without provenance Details for beltpy-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for beltpy 0.2.1
File Interpreter ABI Platform Actions
beltpy-0.2.1-py3-none-any.whl Python 3 none any Details for beltpy-0.2.1-py3-none-any.whl

Total release size: 34.9 kB

Release files / beltpy-0.2.1.tar.gz

Download URL beltpy-0.2.1.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
35c2d47b6876c087ba16fd837dbfe47ba3a2eab344d09deff81e88b9c2c91b30
BLAKE2b-256 checksum
How to use checksums
5c247cf6dfaff6ff3a1912a4e95daab078fb95c82fa75f0f09dd5b33eef3a80b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / beltpy-0.2.1-py3-none-any.whl

Download URL beltpy-0.2.1-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27e8e5ad42306169963e0bf31602c5273b0eb56f27126ad3ec320750ce0b2b53
BLAKE2b-256 checksum
How to use checksums
e76c4712f8ffdc520272359a1ffff0172f6cb740cd98122e5c0eead00e18ccb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for beltpy 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page