Hello, I would like to make some code to draw gears. I have a problem for drawing the involute curve of a teeth. I finally have the function that calculates the curve but i do not find a threshold for stopping at the right time, when hitting the outside circle. -> if angle_inc=0.1,min_angle=0,max_angle=? point_count=(max_angle-min_angle) / angle_inc. How could i determine the max_angle? If i can compute anything defined here: http://www.engineersedge.com/gear_formula.htm. I guess it must be directly related to (module or diametral_pitch), the number of teeth and the angle of pressure. I have read a lot of documentation but i lack a bit of fundamentals math and i'm not natural english speaker, but i think i'm not far of i want. Can someone help me? Thanks!,

try to draw addendum circle, and cut of the curve at point of intersection, where if, curve[x,y] == addendum [x,y]