1、% 齿轮啮合作业一%齿数z=31 法向模数mn=2 法向压力角 an=20 螺旋角为15 齿宽B=15 变为系数x=0.1%-我是分割线-%clear% 各参数的设定%-我是分割线-%z=31; %齿数mn=2; %法向模数an=20/180*pi; %法向压力角b=5/180*pi; %螺旋角B=15; %齿宽x=0.1; %变位系数mt=mn/cos(b); %端面模数at=atan(tan(an)/cos(b); %端面压力角rb=z*mt/2*cos(at); %基圆直径bb=atan(tan(b)*cos(at); %基圆柱螺旋角p=z*mn/(2*sin(b); %节距PI=3/2
2、*pi; %曲面宽度%-我是分割线-%绘制底圆theta=0:2*pi/100:2*pi;X1=rb*cos(theta);Y1=rb*sin(theta);Z1=0*theta;plot3(X1,Y1,Z1)hold on%-我是分割线-%绘制顶圆theta=0:2*pi/100:2*pi;X1=rb*cos(theta);Y1=rb*sin(theta);Z1=p*(0*theta+1);plot3(X1,Y1,Z1)hold on%-我是分割线-%绘制圆柱体M,N=size(theta);for i=1:1:NX=rb*cos(theta(i),rb*cos(theta(i);Y=rb*
3、sin(theta(i),rb*sin(theta(i);Z=0,p;plot3(X,Y,Z)end%-我是分割线-%绘制扫描渐开线a1=0:pi/40:3/2*pi;M,N=size(a1);for i=1:1:Ntheta=0:pi/40:3/2*pi*(N-i+1)/N;X2=rb*cos(theta+a1(i)+rb*theta.*sin(theta+a1(i);Y2=rb*sin(theta+a1(i)-rb*theta.*cos(theta+a1(i);Z2=p/N*i*(0*theta+1);plot3(X2,Y2,Z2)end%-我是分割线-%绘制渐开线螺旋面theta=0:pi/50:PI;M,N=size(theta);for i=1:1:NX=rb*cos(theta(i),rb*cos(theta(i)+rb*theta(i)*sin(theta(i);Y=rb*sin(theta(i),rb*sin(theta(i)-rb*theta(i)*cos(theta(i);Z=p*i/N,0;plot3(X,Y,Z)endhold off%-我是分割线-%绘制螺旋线的法线右旋螺旋面的方程式为: puz ury urx bb sin coscossin sincoscos渐开线方程式为: cossin sincos bb bb rry rrx程序运行结果: