Gears¶
⚙️ Spec sheet → — visual schematic and metrics measured from a real rendered STL.
Pure-Python port of BOSL2’s current gears.scad. Gears are sized by circular pitch
(circ_pitch), metric mod, or diam_pitch; the 20-degree pressure_angle and
profile_shift="auto" defaults match BOSL2, so low-tooth-count gears automatically get the
profile shift that avoids undercut. The involute spur teeth are rack-generated – the working
involute flank plus the trochoid a meshing rack would carve – so low-tooth gears show a real
undercut.
Includes the involute spur_gear2d() / spur_gear()
(helical and/or herringbone), the internal ring_gear(), the linear
rack(), the bevel_gear(), the
worm() / worm_gear() pair, the dimension helpers,
auto_profile_shift(), and gear_dist() for the
meshing centre distance.
.. autoclass:: bosl2.gears.Gears
- members:
Examples¶
These mirror the examples in BOSL2’s gears.scad, rendered live through PythonSCAD.
Examples that rely on BOSL2’s attachment/anchor system, or on features not in this port, are omitted.
spur_gear
A spur gear by circular pitch:
Gears.spur_gear(circ_pitch=5, teeth=20, thickness=8, shaft_diam=5).show()
By metric module:
Gears.spur_gear(mod=2, teeth=20, thickness=8, shaft_diam=5).show()
A helical gear:
Gears.spur_gear(circ_pitch=5, teeth=20, thickness=10, shaft_diam=5, helical=-30, slices=12).show()
A herringbone gear:
Gears.spur_gear(circ_pitch=5, teeth=20, thickness=10, shaft_diam=5, helical=30, herringbone=True, slices=5).show()
ring_gear
An internal ring gear:
Gears.ring_gear(circ_pitch=5, teeth=48, thickness=10).show()
Thicker backing:
Gears.ring_gear(circ_pitch=5, teeth=48, thickness=10, backing=30).show()
A higher pressure angle:
Gears.ring_gear(circ_pitch=5, teeth=48, thickness=10, pressure_angle=28).show()
With a profile shift:
Gears.ring_gear(circ_pitch=5, teeth=48, thickness=10, profile_shift=0.5).show()
Helical:
Gears.ring_gear(circ_pitch=5, teeth=48, thickness=15, helical=30).show()
rack
A linear rack:
Gears.rack(pitch=5, teeth=10, thickness=5).show()
A rack at 14.5 deg pressure angle:
Gears.rack(mod=2, teeth=10, thickness=5, pressure_angle=14.5).show()
bevel_gear
A 45 deg bevel gear:
Gears.bevel_gear(circ_pitch=5, teeth=36, mate_teeth=36, shaft_diam=5).show()
By module:
Gears.bevel_gear(mod=4, teeth=20, face_width=10, pitch_angle=45, shaft_diam=6).show()
worm
A single-start worm:
Gears.worm(circ_pitch=8, diameter=30, length=50).show()
A 3-start worm:
Gears.worm(circ_pitch=8, diameter=30, length=50, starts=3).show()
A left-handed 3-start worm:
Gears.worm(circ_pitch=8, diameter=30, length=50, starts=3, left_handed=True).show()
worm_gear
A worm gear:
Gears.worm_gear(circ_pitch=5, teeth=36, worm_diam=30, worm_starts=1).show()
Left-handed:
Gears.worm_gear(circ_pitch=5, teeth=36, worm_diam=30, worm_starts=1, left_handed=True).show()
Meshing a 4-start worm:
Gears.worm_gear(circ_pitch=5, teeth=36, worm_diam=30, worm_starts=4).show()
By module:
Gears.worm_gear(mod=2, teeth=32, worm_diam=30, worm_starts=1).show()