|
为了避免时间长了文件链接失效,后面的人无法下载,我把楼主在7楼发的命令流发出来
/prep7
zc=25 !被加工齿轮的齿数
pi=3.1415926
fai=2*pi
m=4 !模数
rc=m*zc/2 !分度圆半径
!齿条刀具的齿顶高
ha=1.25*m
!齿条刀具的齿根高
hf=m
au=20*pi/180 !齿形角
pm=pi*m/4 !pi*m是一个基节长度
pm3=3*pi*m/4
lm=(hf/cos(au)/sin(au)+pm)/rc !齿条刀上对应的一个几何尺寸
*dim,MM,array,3,3 !坐标变换矩阵,跟着theta变化
n=1
da=m*zc+hf*2 !齿顶圆直径
df=m*zc-ha*2 !齿根圆直径
ra=da/2
!第2段
*do,theta,lm,-lm,-0.015
px=rc*cos(theta+pi/2)
py=rc*sin(theta+pi/2)
s=rc*theta
o1x=px+s*cos(theta)
o1y=py+s*sin(theta)
MM(1,1)=cos(theta)
MM(1,2)=-sin(theta)
MM(1,3)=o1x
MM(2,1)=sin(theta)
MM(2,2)=cos(theta)
MM(2,3)=o1y
MM(3,1)=0
MM(3,2)=0
MM(3,3)=1
*if,s,gt,pm-ha/cos(au)/sin(au)+0.025*rc,and,s,lt,pm+hf/cos(au)/sin(au),then
pp1=-s+(s-pm)*(cos(au))**2
pp2=(s-pm)*cos(au)*sin(au)
pp3=1
ppx=MM(1,1)*pp1+MM(1,2)*pp2+MM(1,3)*pp3
ppy=MM(2,1)*pp1+MM(2,2)*pp2+MM(2,3)*pp3
k,n,ppx,ppy
n=n+1
*endif
*enddo
!左尖点
*do,theta,-lm,lm,0.01
px=rc*cos(theta+pi/2)
py=rc*sin(theta+pi/2)
s=rc*theta
o1x=px+s*cos(theta)
o1y=py+s*sin(theta)
MM(1,1)=cos(theta)
MM(1,2)=-sin(theta)
MM(1,3)=o1x
MM(2,1)=sin(theta)
MM(2,2)=cos(theta)
MM(2,3)=o1y
MM(3,1)=0
MM(3,2)=0
MM(3,3)=1
*if,s,lt,pm-ha*tan(au),and,s,gt,pm-ha/cos(au)/sin(au)+0.007*rc,then
pp1=-pm+ha*tan(au)
pp2=-ha
pp3=1
ppx=MM(1,1)*pp1+MM(1,2)*pp2+MM(1,3)*pp3
ppy=MM(2,1)*pp1+MM(2,2)*pp2+MM(2,3)*pp3
k,n,ppx,ppy
n=n+1
*endif
*enddo
!第3段
*do,theta,lm,-lm,-0.004
px=rc*cos(theta+pi/2)
py=rc*sin(theta+pi/2)
s=rc*theta
o1x=px+s*cos(theta)
o1y=py+s*sin(theta)
MM(1,1)=cos(theta)
MM(1,2)=-sin(theta)
MM(1,3)=o1x
MM(2,1)=sin(theta)
MM(2,2)=cos(theta)
MM(2,3)=o1y
MM(3,1)=0
MM(3,2)=0
MM(3,3)=1
*if,s,gt,-pm+ha*tan(au),and,s,lt,pm-ha*tan(au),then
pp1=-s
pp2=-ha
pp3=1
ppx=MM(1,1)*pp1+MM(1,2)*pp2+MM(1,3)*pp3
ppy=MM(2,1)*pp1+MM(2,2)*pp2+MM(2,3)*pp3
k,n,ppx,ppy
n=n+1
*endif
*enddo
!右尖点
*do,theta,-lm,lm,0.01
px=rc*cos(theta+pi/2)
py=rc*sin(theta+pi/2)
s=rc*theta
o1x=px+s*cos(theta)
o1y=py+s*sin(theta)
MM(1,1)=cos(theta)
MM(1,2)=-sin(theta)
MM(1,3)=o1x
MM(2,1)=sin(theta)
MM(2,2)=cos(theta)
MM(2,3)=o1y
MM(3,1)=0
MM(3,2)=0
MM(3,3)=1
*if,s,gt,-pm+ha*tan(au),and,s,lt,-pm+ha/cos(au)/sin(au),then
pp1=pm-ha*tan(au)
pp2=-ha
pp3=1
ppx=MM(1,1)*pp1+MM(1,2)*pp2+MM(1,3)*pp3
ppy=MM(2,1)*pp1+MM(2,2)*pp2+MM(2,3)*pp3
k,n,ppx,ppy
n=n+1
*endif
*enddo
!第四段
*do,theta,lm,-lm,-0.015
px=rc*cos(theta+pi/2)
py=rc*sin(theta+pi/2)
s=rc*theta
o1x=px+s*cos(theta)
o1y=py+s*sin(theta)
MM(1,1)=cos(theta)
MM(1,2)=-sin(theta)
MM(1,3)=o1x
MM(2,1)=sin(theta)
MM(2,2)=cos(theta)
MM(2,3)=o1y
MM(3,1)=0
MM(3,2)=0
MM(3,3)=1
*if,s,gt,-pm-hf/cos(au)/sin(au),and,s,lt,ha/cos(au)/sin(au)-pm-0.025*rc,then
pp1=pm-(pm+s)*(sin(au))**2
pp2=-(pm+s)*sin(au)*cos(au)
pp3=1
ppx=MM(1,1)*pp1+MM(1,2)*pp2+MM(1,3)*pp3
ppy=MM(2,1)*pp1+MM(2,2)*pp2+MM(2,3)*pp3
k,n,ppx,ppy
n=n+1
*endif
*enddo
!将以上的点用spline连接
FLST,3,n-1,3
*do,theta,1,n-1,1
FITEM,3,theta
*enddo
BSPLIN, ,P51X
!阵列
csys,1
lgen,zc,1,,,,360/zc
csys,0
*get,nn,kp,,count
n=nn+1
!画齿顶圆
*do,theta,0,2*pi,0.04
px=rc*cos(theta+pi/2)
py=rc*sin(theta+pi/2)
s=rc*theta
o1x=px+s*cos(theta)
o1y=py+s*sin(theta)
MM(1,1)=cos(theta)
MM(1,2)=-sin(theta)
MM(1,3)=o1x
MM(2,1)=sin(theta)
MM(2,2)=cos(theta)
MM(2,3)=o1y
MM(3,1)=0
MM(3,2)=0
MM(3,3)=1
pp1=-s
pp2=hf
pp3=1
ppx=MM(1,1)*pp1+MM(1,2)*pp2+MM(1,3)*pp3
ppy=MM(2,1)*pp1+MM(2,2)*pp2+MM(2,3)*pp3
k,n,ppx,ppy
n=n+1
*enddo
!将齿顶圆用spline连接
FLST,3,n-nn,3
*do,theta,nn+1,n-1,1
FITEM,3,theta
*enddo
fitem,3,nn+1
BSPLIN, ,P51X
!删掉齿顶圆以外的线
csys,1
LSEL,U, , , zc+1
cm,_chikuo,line
allsel,all
LSBL,_chikuo,zc+1
LSEL,S,LOC,X,rc,rc+ha
ldele,all
allsel all
csys,0
numcmp,line
numcmp,kp
!连接齿顶
*get,center,kp,,num,max
center=center+1
k,center,0,0
*do,i,1,zc-1,1
lsel,s,,,i
ksll,s
*get,p1,kp,,num,min
allsel,all
lsel,s,,,i+1
ksll,s
*get,p2,kp,,num,max
allsel,all
larc,p1,p2,center,ra
*enddo
lsel,s,,,zc
ksll,s
*get,p1,kp,,num,min
allsel,all
lsel,s,,,1
ksll,s
*get,p2,kp,,num,max
allsel,all
larc,p1,p2,center,ra |
|