beltpy 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- beltpy-0.1.1/LICENSE +21 -0
- beltpy-0.1.1/PKG-INFO +196 -0
- beltpy-0.1.1/README.md +155 -0
- beltpy-0.1.1/pyproject.toml +29 -0
- beltpy-0.1.1/setup.cfg +4 -0
- beltpy-0.1.1/src/beltpy/__init__.py +3 -0
- beltpy-0.1.1/src/beltpy/beltpy.py +643 -0
- beltpy-0.1.1/src/beltpy/profiles.py +110 -0
- beltpy-0.1.1/src/beltpy/pytooth.py +748 -0
- beltpy-0.1.1/src/beltpy.egg-info/PKG-INFO +196 -0
- beltpy-0.1.1/src/beltpy.egg-info/SOURCES.txt +12 -0
- beltpy-0.1.1/src/beltpy.egg-info/dependency_links.txt +1 -0
- beltpy-0.1.1/src/beltpy.egg-info/requires.txt +4 -0
- beltpy-0.1.1/src/beltpy.egg-info/top_level.txt +1 -0
beltpy-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vincewall
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
beltpy-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: beltpy
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Geometric solver and visualizer for GT-belt systems
|
|
5
|
+
Author-email: Vincent Wallsten <vincent.wallsten03@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 vincewall
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: HomePage, https://github.com/vincewall/pybeltsolver
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/vincewall/pybeltsolver/issues
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: Operating System :: OS Independent
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
33
|
+
Requires-Python: >=3.9
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
License-File: LICENSE
|
|
36
|
+
Requires-Dist: scipy>=1.7.0
|
|
37
|
+
Requires-Dist: matplotlib>=3.4.0
|
|
38
|
+
Requires-Dist: numpy>=1.21.0
|
|
39
|
+
Requires-Dist: pybeltsolver>=0.1.1
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# Beltpy: Geometric Solver and Visualizer for timing belts!
|
|
46
|
+
|
|
47
|
+
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.
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
Install using pip:
|
|
51
|
+
```commandline
|
|
52
|
+
pip install beltpy
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Examples
|
|
56
|
+
|
|
57
|
+
The procedure to define a valid path configuration is identical for this module as in `pybeltsolver`.
|
|
58
|
+
|
|
59
|
+
### Example 1
|
|
60
|
+
This example demonstrates a belt system with 3 pulleys, one of which is a tensioner, using the GT2 belt profile
|
|
61
|
+
```python
|
|
62
|
+
import matplotlib.pyplot as plt
|
|
63
|
+
import numpy as np
|
|
64
|
+
from pybeltsolver import Belt, BeltFace
|
|
65
|
+
|
|
66
|
+
from beltpy import BeltSystem, SmoothPulley, ToothedPulley
|
|
67
|
+
from beltpy.profiles import GT2
|
|
68
|
+
|
|
69
|
+
# This example demonstrates a belt system with 3 pulleys, one of which is movable.
|
|
70
|
+
|
|
71
|
+
profile = GT2
|
|
72
|
+
|
|
73
|
+
p1 = ToothedPulley(
|
|
74
|
+
teeth=53,
|
|
75
|
+
coords=(0, 0),
|
|
76
|
+
profile=profile,
|
|
77
|
+
name="Pulley 1",
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
p2 = SmoothPulley(
|
|
81
|
+
diameter=23 * 2 / np.pi,
|
|
82
|
+
coords=(50, 8),
|
|
83
|
+
profile=profile,
|
|
84
|
+
name="Idler",
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
p3 = ToothedPulley(
|
|
88
|
+
teeth=20,
|
|
89
|
+
coords=(78.87, 0),
|
|
90
|
+
profile=profile,
|
|
91
|
+
name="Pulley 2",
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
routing = [BeltFace.FRONT, BeltFace.BACK, BeltFace.FRONT]
|
|
95
|
+
midline = Belt(circles=[p1, p2, p3], topology=routing, allow_crossing=True)
|
|
96
|
+
|
|
97
|
+
belt_length = midline.total_length
|
|
98
|
+
|
|
99
|
+
target_length = belt_length // profile.pitch * profile.pitch
|
|
100
|
+
midline.find_movable_circle_position(target_length, 1, np.array([0, 1]))
|
|
101
|
+
|
|
102
|
+
system = BeltSystem(
|
|
103
|
+
belt=midline,
|
|
104
|
+
profile=profile,
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
fig, ax = system.plot(detailed=False, show=False)
|
|
108
|
+
|
|
109
|
+
ax.grid()
|
|
110
|
+
plt.show()
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
### Example 2
|
|
116
|
+
This example demonstrates a belt system with 4 pulleys, one of which is a tensioner, using the GT3 profile.
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
import matplotlib.pyplot as plt
|
|
120
|
+
import numpy as np
|
|
121
|
+
from pybeltsolver import Belt, BeltFace
|
|
122
|
+
|
|
123
|
+
from beltpy import BeltSystem, SmoothPulley, ToothedPulley
|
|
124
|
+
from beltpy.profiles import GT3
|
|
125
|
+
|
|
126
|
+
# This example demonstrates a belt system with 4 pulleys, one of which is movable.
|
|
127
|
+
|
|
128
|
+
profile = GT3
|
|
129
|
+
|
|
130
|
+
p1 = ToothedPulley(
|
|
131
|
+
teeth=25,
|
|
132
|
+
coords=(0, 0),
|
|
133
|
+
profile=profile,
|
|
134
|
+
name="Pulley 1",
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
p2 = SmoothPulley(
|
|
138
|
+
diameter=23 * 2 / np.pi,
|
|
139
|
+
coords=(50, 8),
|
|
140
|
+
profile=profile,
|
|
141
|
+
name="Idler",
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
p3 = ToothedPulley(
|
|
145
|
+
teeth=20,
|
|
146
|
+
coords=(78.87, 0),
|
|
147
|
+
profile=profile,
|
|
148
|
+
name="Pulley 2",
|
|
149
|
+
)
|
|
150
|
+
p4 = ToothedPulley(
|
|
151
|
+
teeth=35,
|
|
152
|
+
coords=(30, -29),
|
|
153
|
+
profile=profile,
|
|
154
|
+
name="Pulley 3",
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
routing = [
|
|
158
|
+
BeltFace.FRONT,
|
|
159
|
+
BeltFace.BACK,
|
|
160
|
+
BeltFace.FRONT,
|
|
161
|
+
BeltFace.FRONT,
|
|
162
|
+
]
|
|
163
|
+
midline = Belt(
|
|
164
|
+
circles=[p1, p2, p3, p4],
|
|
165
|
+
topology=routing,
|
|
166
|
+
allow_crossing=True,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
belt_length = midline.total_length
|
|
170
|
+
target_length = belt_length // profile.pitch * profile.pitch
|
|
171
|
+
midline.find_movable_circle_position(
|
|
172
|
+
target_length,
|
|
173
|
+
1,
|
|
174
|
+
np.array([0, 1]),
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
system = BeltSystem(
|
|
178
|
+
belt=midline,
|
|
179
|
+
profile=profile,
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
fig, ax = system.plot(detailed=False, show=False)
|
|
183
|
+
|
|
184
|
+
ax.grid()
|
|
185
|
+
plt.show()
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+

|
|
189
|
+
|
|
190
|
+
### How to add your own tooth-profile
|
|
191
|
+
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:
|
|
192
|
+
|
|
193
|
+

|
|
194
|
+
|
|
195
|
+
To add a profile, simply follow the GT2 and GT3 examples found in `src/beltpy/profiles.py`.
|
|
196
|
+
|
beltpy-0.1.1/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Beltpy: Geometric Solver and Visualizer for timing belts!
|
|
5
|
+
|
|
6
|
+
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.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
Install using pip:
|
|
10
|
+
```commandline
|
|
11
|
+
pip install beltpy
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
The procedure to define a valid path configuration is identical for this module as in `pybeltsolver`.
|
|
17
|
+
|
|
18
|
+
### Example 1
|
|
19
|
+
This example demonstrates a belt system with 3 pulleys, one of which is a tensioner, using the GT2 belt profile
|
|
20
|
+
```python
|
|
21
|
+
import matplotlib.pyplot as plt
|
|
22
|
+
import numpy as np
|
|
23
|
+
from pybeltsolver import Belt, BeltFace
|
|
24
|
+
|
|
25
|
+
from beltpy import BeltSystem, SmoothPulley, ToothedPulley
|
|
26
|
+
from beltpy.profiles import GT2
|
|
27
|
+
|
|
28
|
+
# This example demonstrates a belt system with 3 pulleys, one of which is movable.
|
|
29
|
+
|
|
30
|
+
profile = GT2
|
|
31
|
+
|
|
32
|
+
p1 = ToothedPulley(
|
|
33
|
+
teeth=53,
|
|
34
|
+
coords=(0, 0),
|
|
35
|
+
profile=profile,
|
|
36
|
+
name="Pulley 1",
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
p2 = SmoothPulley(
|
|
40
|
+
diameter=23 * 2 / np.pi,
|
|
41
|
+
coords=(50, 8),
|
|
42
|
+
profile=profile,
|
|
43
|
+
name="Idler",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
p3 = ToothedPulley(
|
|
47
|
+
teeth=20,
|
|
48
|
+
coords=(78.87, 0),
|
|
49
|
+
profile=profile,
|
|
50
|
+
name="Pulley 2",
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
routing = [BeltFace.FRONT, BeltFace.BACK, BeltFace.FRONT]
|
|
54
|
+
midline = Belt(circles=[p1, p2, p3], topology=routing, allow_crossing=True)
|
|
55
|
+
|
|
56
|
+
belt_length = midline.total_length
|
|
57
|
+
|
|
58
|
+
target_length = belt_length // profile.pitch * profile.pitch
|
|
59
|
+
midline.find_movable_circle_position(target_length, 1, np.array([0, 1]))
|
|
60
|
+
|
|
61
|
+
system = BeltSystem(
|
|
62
|
+
belt=midline,
|
|
63
|
+
profile=profile,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
fig, ax = system.plot(detailed=False, show=False)
|
|
67
|
+
|
|
68
|
+
ax.grid()
|
|
69
|
+
plt.show()
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
### Example 2
|
|
75
|
+
This example demonstrates a belt system with 4 pulleys, one of which is a tensioner, using the GT3 profile.
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import matplotlib.pyplot as plt
|
|
79
|
+
import numpy as np
|
|
80
|
+
from pybeltsolver import Belt, BeltFace
|
|
81
|
+
|
|
82
|
+
from beltpy import BeltSystem, SmoothPulley, ToothedPulley
|
|
83
|
+
from beltpy.profiles import GT3
|
|
84
|
+
|
|
85
|
+
# This example demonstrates a belt system with 4 pulleys, one of which is movable.
|
|
86
|
+
|
|
87
|
+
profile = GT3
|
|
88
|
+
|
|
89
|
+
p1 = ToothedPulley(
|
|
90
|
+
teeth=25,
|
|
91
|
+
coords=(0, 0),
|
|
92
|
+
profile=profile,
|
|
93
|
+
name="Pulley 1",
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
p2 = SmoothPulley(
|
|
97
|
+
diameter=23 * 2 / np.pi,
|
|
98
|
+
coords=(50, 8),
|
|
99
|
+
profile=profile,
|
|
100
|
+
name="Idler",
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
p3 = ToothedPulley(
|
|
104
|
+
teeth=20,
|
|
105
|
+
coords=(78.87, 0),
|
|
106
|
+
profile=profile,
|
|
107
|
+
name="Pulley 2",
|
|
108
|
+
)
|
|
109
|
+
p4 = ToothedPulley(
|
|
110
|
+
teeth=35,
|
|
111
|
+
coords=(30, -29),
|
|
112
|
+
profile=profile,
|
|
113
|
+
name="Pulley 3",
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
routing = [
|
|
117
|
+
BeltFace.FRONT,
|
|
118
|
+
BeltFace.BACK,
|
|
119
|
+
BeltFace.FRONT,
|
|
120
|
+
BeltFace.FRONT,
|
|
121
|
+
]
|
|
122
|
+
midline = Belt(
|
|
123
|
+
circles=[p1, p2, p3, p4],
|
|
124
|
+
topology=routing,
|
|
125
|
+
allow_crossing=True,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
belt_length = midline.total_length
|
|
129
|
+
target_length = belt_length // profile.pitch * profile.pitch
|
|
130
|
+
midline.find_movable_circle_position(
|
|
131
|
+
target_length,
|
|
132
|
+
1,
|
|
133
|
+
np.array([0, 1]),
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
system = BeltSystem(
|
|
137
|
+
belt=midline,
|
|
138
|
+
profile=profile,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
fig, ax = system.plot(detailed=False, show=False)
|
|
142
|
+
|
|
143
|
+
ax.grid()
|
|
144
|
+
plt.show()
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+

|
|
148
|
+
|
|
149
|
+
### How to add your own tooth-profile
|
|
150
|
+
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:
|
|
151
|
+
|
|
152
|
+

|
|
153
|
+
|
|
154
|
+
To add a profile, simply follow the GT2 and GT3 examples found in `src/beltpy/profiles.py`.
|
|
155
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "beltpy"
|
|
3
|
+
description = "Geometric solver and visualizer for GT-belt systems"
|
|
4
|
+
readme = "README.md"
|
|
5
|
+
version = "0.1.1"
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "Vincent Wallsten", email = "vincent.wallsten03@gmail.com" }
|
|
9
|
+
]
|
|
10
|
+
dependencies = [
|
|
11
|
+
"scipy>=1.7.0",
|
|
12
|
+
"matplotlib>=3.4.0",
|
|
13
|
+
"numpy>=1.21.0",
|
|
14
|
+
"pybeltsolver>=0.1.1"
|
|
15
|
+
]
|
|
16
|
+
license = {file = "LICENSE"}
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[build-system]
|
|
24
|
+
requires = ["setuptools>=65.5.0"]
|
|
25
|
+
build-backend = "setuptools.build_meta"
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
HomePage = "https://github.com/vincewall/pybeltsolver"
|
|
29
|
+
"Bug Tracker" = "https://github.com/vincewall/pybeltsolver/issues"
|
beltpy-0.1.1/setup.cfg
ADDED