GarryBGoode / gggears

a gear generator in python
Apache License 2.0
0 stars 0 forks source link

gggears

A gear generator in python.

Installation

This project is not yet registered on pypi. You can install it from git via pip:

pip install git+https://github.com/GarryBGoode/gggears.git@main

Or download repository and install locally. Navigate to the repository folder and:

pip install .

Dependencies

Gggears CAD model creation uses build123d package: build-123d github

It is highly recommended, though not strictly necessary to use a python-CAD gui solution. See OCP VSCode and CadQuery Editor.

Features

Gear generation:

Gear positioning and alignment supported.

Bevel Gear Example

Not yet supported:

Planned upcoming other features

Example

The example is built on VSCode with OCP VScode plugin. See examples.py for more.

from gggears import *
from ocp_vscode import show, set_port
set_port(3939)

# create 2 spur gears
gear1 = SpurGear(number_of_teeth=12)
gear2 = SpurGear(number_of_teeth=24)

# move and align gear 1 next to gear 2 in the Y direction
gear1.mesh_to(gear2, target_dir=UP)

# generate build123d Part objects
gear_part_1 = gear1.build_part()
gear_part_2 = gear2.build_part()

# visualize parts
show(gear_part_1, gear_part_2)

Bevel Gear Example

License

Project is licensed under Apache 2.0, see license file for details.