I'm trying to model Hypoid Gears for a model that I'm making. I'm doing the model in AutoCAD/Inventor, but the only decent free tutorial that I've found for modeling Hypoid Gears is meant for Blender. Most of the steps from the tutorial can be done in AutoCAD, but there's this one part where they use a Python script to transform a flat gear pattern into a cone shape for the gear. I'm having difficulty understanding how the script works since I don't know Python. Would someone be able to explain how the script is transforming the gear sketch so I can try and recreate it in CAD.
This calculator made the following script:
import bpy
from math import *
obj=bpy.context.object
mesh=obj.data
for i in range(0, len(mesh.vertices)):
vert=mesh.vertices[i]
x=vert.co[0]
y=vert.co[1]
z=vert.co[2]
R=3.970
alpha=14.031*pi/180
r=sqrt(x*x+y*y)
teta=atan2(y, x)
rnew=R+(r-R)*cos(alpha)
xnew=rnew*cos(teta)
ynew=rnew*sin(teta)
znew=(r-R)*sin(alpha)
vert.co[0]=xnew
vert.co[1]=ynew
vert.co[2]=znew