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 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()
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:
To add a profile, simply follow the GT2 and GT3 examples found in src/beltpy/profiles.py.
Metadata
Release files for beltpy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| beltpy-0.1.1.tar.gz | 17.6 kB | Without provenance | Details for beltpy-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| beltpy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for beltpy-0.1.1-py3-none-any.whl |
Total release size: 34.9 kB
Release files / beltpy-0.1.1.tar.gz
| Download URL | beltpy-0.1.1.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
144c3b69378a62cc6bdbafa145d471310febaa373f37dcc5dcd0be972484e479
|
|
BLAKE2b-256 checksum How to use checksums |
a44d3148ba44e85108ba7a0fdeaaeb34e47b4111d9d633da45d086465fde73d9
|
| 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.1.1-py3-none-any.whl
| Download URL | beltpy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 17.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
386210a4e425f03e7ef086e9c4ef20a21fdbb3e12b9f91db6b6a1898d382bb50
|
|
BLAKE2b-256 checksum How to use checksums |
8070ce84144e0b05302073999c2b30c1c4fd5dc699e986619db944a519e35bdd
|
| 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.1.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.