Rolling a rack to create a gear profile

 From:  Fubax
11914.1 
Hi,
I've been working on a special gear design for my 3D print project and was able to draw a very nice involute gear profile using a modified Circular Array script.
The process of designing the gear was hybrid, I only used the function to create the undercut by roll-arraying the center point of a rack tooth circular tip, then drawing a through point spline and offsetting it by the tip radius.
For the tooth I just used standard involute shape made by FxGraph3D script:
_FxGraph3D a*(cos(u)+u*sin(u));a*(sin(u)-u*cos(u));0;0;6.283185307179586;0;0;50;0;1;;;V
, as the array produces involute profile at some arbitrary points along the rack tooth edge, which are hard to trace with a hand-drawn spline.



I've used Gemini Pro model to generate this script (see attachment ZIP). The principle works like this:
Simple straight-line rack rotates around a circle with a offset, such that there's no slip at a given radius. The circular array function has "Radial Step" parameter which does just that when it's a negative value.
The script works only for a rack placed on the bottom of the gear or top (negative radius must be used). This modified script accepts the roll radius/diameter value as input (tooth module * number of teeth = diameter) and calculates corresponding "Radial Offset".

Now I have an issue, because I want to create a non-circular involute gear, and I need to "roll-array" the rack over a curve (arch) with parallel offset to the curve to avoid slip at each step. I believe it would be possible with MoI, the script would essentially be the "Curve Array" with a roll offset option.
I haven't tried to make it using AI yet, and maybe some human ingenuity already made something like it. Anyway just asking.