Version 1.0.2 Released! Zero-thickness walls removed.
Constructed using the sweep() module from list-comprehension-demos and related functions from scad-utils.
The default gear renders in 50 seconds on my 4GHz desktop computer. Just for reference.
Customizer doesn't want to play nicely with my code, but I don't know why...
After searching for ways to perform a twisted rotational extrusion in OpenSCAD (as the original designer did in SolidWorks), I found that I was better off simulating it with my own code. First, I got myself familiar with involute_gears from MCAD, and combined it with translate() and rotate(). Next, I used a for() statement to generate a coarse version of the twisted torus and cut it out from the cylinder. This proved to be messy and difficult to render.
Then I realized that I could simply cut the gear "slice" out of a corresponding prism (which gave better looking results once I fattened and offset the gear slices to remove 0-thickness walls). Tweaking the twist angle and resolution, and adding an angle variable, produced the file here now.
REVISION: The gear is now made using the sweep() function. It produces a much smoother gear than before, but I have to make two half-toruses in order to perform the cut correctly. The twist is set to allow both odd- and even-toothed involute profiles.
First uploaded attempt.
Only capable of using a regular cylinder as shape to cut from.
No sizing options.
Required input of twist_angle.
Added variables for Customizer.
Added a chamfered cylinder option.
Still needed twist_angle.
Better Customizer support; uses supported comment lines.
Replaced twist_angle with a built-in expression that keeps the outermost surfaces smooth.
Even better Customizer support; separates variables into tabs.
Added options to generate a whole, half, or split worm gear.
Almost at 1.0...
Overhauled code now uses the sweep() module, resulting in a much smoother shape.
Cannot use an involute profile with an odd number of teeth.
Twist is stuck at full 360 degree rotation, the rotation ratio is a placeholder.
Zero-thickness walls are generated by the two-piece method of cutting; does not affect slic3r's output Gcode.
Capable of producing a smooth hyperbolic worm gear with user-defined values including (but not limited to): Number of teeth engaged/disengaged per rotation, number of teeth in the involute profile, number of segments, dimensions of the core, core type, format of the overall gear, and other gear settings used in MCAD's involute gear modules.
Still has zero-thickness walls, should be removed in the next version.
Version 1.0 plus the ability to generate a mating wheel gear and set the tolerance of the gears.
Version 1.0.2 (current)
Zero-thickness wall removed.