manim-Gearbox
This is a plugin for Manim that enables you to draw realistic looking gears and mechanisms. Mostly based on these tec-science pages: https://www.tec-science.com/mechanical-power-transmission/involute-gear/geometry-of-involute-gears/
Currently supported Involute gear features:
- Basic spur gears
- Inside ring-gears
- Basic rack
- Undercutting (gears with fewer than 17 teeth)
- Profile shifted gears
- Meshing calculation with distance variation
Planned further development:
- Cycloid gears, cycloid rack
Installation
manim-gearbox is a package on pypi, and can be directly installed using pip:
pip install manim-gearbox
Note: manim-gearbox uses, and depends on SciPy and Manim.
Usage
Make sure include these two imports at the top of the .py file
from manim import *
from manim_gearbox import *
Add Gear objects, use mesh_to() method to position 2 gears into meshing. I tend to use 'fill_opacity=1' and 'stroke_opacity=0' options because the stroke increases the gear size by a couple pixels, and gives the feeling of interference.
Examples
2 basic gears
class gear_example(Scene):
def construct(self):
# small gear
gear1=Gear(15, stroke_opacity=0, fill_color=WHITE,fill_opacity=1)
# larger gear
gear2=Gear(25, stroke_opacity=0, fill_color=RED, fill_opacity=1)
# shifting gear1 away from center
gear1.shift(-gear1.rp * 1.5 * RIGHT)
# position gear2 next to gear1 so that they mesh together
gear2.mesh_to(gear1)
self.add(gear1, gear2)
self.play(Rotate(gear1, gear1.pitch_angle, rate_func=linear),
Rotate(gear2, - gear2.pitch_angle, rate_func=linear),
run_time=4)
inner gear
class gear_example_inner(Scene):
def construct(self):
# smaller gear
gear1 = Gear(12, module=1, profile_shift=0.3, stroke_opacity=0, fill_color=WHITE,fill_opacity=1)
# larger gear with inner teeth
gear2 = Gear(36, module=1, inner_teeth=True, profile_shift=0.1, stroke_opacity=0, fill_color=RED, fill_opacity=1)
gear1.shift(gear1.rp * UP)
gear2.shift(gear2.rp * UP)
# mesh with 0.15*module larger distance than default
# bias param is used to define left or right tooth flank shall engage if there is offset and play
gear2.mesh_to(gear1,offset=0.15,bias=False)
self.add(gear1)
self.add(gear2)
self.play(Rotate(gear1, gear1.pitch_angle, rate_func=linear),
Rotate(gear2, gear2.pitch_angle, rate_func=linear),
run_time=10)
Metadata
Release files for manim-gearbox 0.2.4
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 |
|---|---|---|---|---|
| manim-GearBox-0.2.4.tar.gz | 10.0 kB | Without provenance | Details for manim-GearBox-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| manim_GearBox-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for manim_GearBox-0.2.4-py3-none-any.whl |
Total release size: 19.8 kB
Release files / manim-GearBox-0.2.4.tar.gz
| Download URL | manim-GearBox-0.2.4.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
865232bd3d0ccde664d66f295b20b3001efda6a11631a6172f6d955c655a13d8
|
|
BLAKE2b-256 checksum How to use checksums |
7881f50fbc773896d3371fbcc5e4355576db8d241eacb40a9780f46657a8091b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.9 Windows/10
|
Release files / manim_GearBox-0.2.4-py3-none-any.whl
| Download URL | manim_GearBox-0.2.4-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b197f04a993d88f2ed54a651d99229ff37982a0f30cec012011bf7bf48994513
|
|
BLAKE2b-256 checksum How to use checksums |
2d66ecd982e037206b87fa6de9a82ff724f1625d4ecd8ead947475cca3618867
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.9 Windows/10
|
Security for manim-gearbox 0.2.4
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.