My first attempt at a parametric object. The critical parameters that define a cycloid gear in this module are its circular pitch and number of teeth; the code then extrapolates other dimensions from there. As long as two gears have the same circular pitch they should mesh.
Please exercise the object and post here if you find any bugs! Will also post revisions to this Gist at GitHub.
You'll need OpenSCAD in order to convert this script into a gear STL.
The module you should concern yourself with is
CycloidGear, it has a prototype like this:
module CycloidGear(num_teeth, circ_pitch, base_circle_ratio, pinion_circle_ratio, h)
num_teeth is the number of teeth.
circ_pitch is the circular pitch, the length of an arc from the center of one tooth to the next, along the root circle. (The circumference of the root circle is
num_teeth * circ_pitch.)
base_circle_ratio is the ratio of the base circle radius, the large circle the epicycle rolls around, to the root circular pitch. The default is to make it 6 times the length of the circular pitch.
pinion_circle_ratio is the ratio of the pinion circle radius, the small circle that rolls around the base circle, to the circular pitch. By default this circle's radius is equal to the circular pitch.
h is the height of the gear.
The gear is rendered with its origin at the origin of the context, with its rotational axis along the Z. Specifying a hole for an axle is not included in this module.
Also available is a
$precision global variable. This controls how many polygons are used to construct the the curves that form the tooth.