先贴程序,然后prt
entity/pt(100),ln(100),cr(100),obj1(100),obj2(100),ent(100)
number/nd,ndi,nr,k,wd,wr,mat1(12),mat2(12),mat3(12),mat4(12),mat5(12)
data/ndi,23,k,250
ln(1)=line/0,-100,0,100
mat1=matrix/mirror,ln(1)
$$---------------------轮胎--------------------$$
$$输入轮胎相应尺寸参数
back:
param/'输入参数','轮辋直径(in)',ndi,'轮胎宽度(mm)',k,rsp
jump/back:,cancel:,ok:,rsp
ok:
$$判断参数正误
ifthen/ndi<14 or ndi>25
messg/'轮辋直径超出范围(14-25),请重新输入'
jump/back:
else
jump/l1:
endif
l1:
ifthen/k<150 or k>350
messg/'轮胎宽度超出范围(150-350),请重新输入'
jump/back:
else
jump/l2:
endif
l2:
nd=ndi*1000/36
wd=1.5*nd
nr=nd/2
wr=wd/2
$$生成半轮胎周向截面点、线
pt(1)=point/(-k/2*0.93),(0.98*wr)
pt(2)=point/(-k/4),(0.99*wr)
pt(3)=point/0,wr
pt(4)=point/(-k/2),(wr+nr)/2
pt(5)=point/(-k/2*0.93),nr
pt(6)=point/pt(5),delta,(k/30),(-0.1*nr),0
pt(7)=point/0,0.9*nr
pt(8)=point/pt(1),delta,5,-5,0
pt(9)=point/pt(6),delta,5,5,0
pt(10)=point/pt(5),delta,5,0,0
cr(1)=circle/pt(3),pt(2),pt(1)
cr(2)=circle/pt(1),pt(4),pt(5)
ln(2)=line/pt(5),pt(6)
ln(3)=line/pt(6),pt(7)
ln(4)=line/pt(7),pt(3)
$$倒角处理
obj1(1)=fillet/cr(1),cr(2),center,pt(8),radius,15
obj1(2)=fillet/cr(2),ln(2),center,pt(10),radius,15
obj1(3)=fillet/ln(2),ln(3),center,pt(9),radius,15
$$旋转
ent(1)=solrev/cr(1..2),ln(2..4),obj1(1..3),origin,0,0,0,atangl,360,axis,1,0,0
$$花纹线
ln(5)=line/-k/2,k/8,wr+10,-k/4,k/8,wr+10
ln(6)=line/-k/4,k/8,wr+10,-k/6,0,wr+10
ln(7)=line/-k/2,k/8,wr+10,-k/2,k/4,wr+10
ln(8)=line/-k/2,k/4,wr+10,-k/5,k/4,wr+10
ln(9)=line/-k/5,k/4,wr+10,-k/24,0,wr+10
ln(10)=line/-k/24,0,wr+10,-k/6,0,wr+10
$$切花纹
mat2=matrix/mirror,ln(10)
obj1(5)=solext/ln(5..10),height,10+wr/30,axis,0,0,-1
obj1(6)=transf/mat2,obj1(5)
obj1(7)=unite/obj1(5),with,obj1(6)
i=intf(3.1415926*wd/(3*k/8))
n=1
j=8
xh1:
ifthen/n<=i-1
mat3=matrix/yzrot,n*(360/i)
obj1(j)=transf/mat3,obj1(7)
j=j+1
n=n+1
jump/xh1:
endif
ent(2)=subtra/ent(1),with,obj1(7..j-1)
ent(3)=transf/mat1,ent(2)
mat4=matrix/yzrot,360/i/2
ent(4)=transf/mat4,ent(3),move
ent(5)=unite/ent(2),with,ent(4)
&color(ent(5))=&gray
$$----------------------轮毂--------------------$$
$$轮毂截面点、线
pt(11)=transf/mat1,pt(6)
pt(12)=point/pt(6),delta,0,-wd/40,0
pt(13)=transf/mat1,pt(12)
pt(14)=point/pt(7),delta,0,-wd/40*2,0
ln(11)=line/pt(11),pt(6)
ln(12)=line/pt(6),pt(12)
ln(13)=line/pt(11),pt(13)
cr(3)=circle/pt(12),pt(14),pt(13)
pt(15)=point/pt(14),delta,-k/5,wd/30,0
pt(16)=point/pt(15),delta,-k/10,0,0
ln(14)=line/pt(15),pt(16)
pt(17)=point/pt(15),delta,-k/30,-0.2*nr,0
pt(18)=point/pt(17),delta,-k/15,-0.2*nr,0
pt(19)=point/pt(18),delta,-k/10,-0.2*nr,0
pt(20)=point/-0.4*k,0
pt(21)=point/pt(17),delta,-k/10,0,0
pt(22)=point/pt(18),delta,-k/10,0,0
pt(23)=point/pt(19),delta,-k/10,0,0
pt(24)=point/-0.5*k,0
cr(4)=circle/pt(18),pt(17),pt(15)
cr(5)=circle/pt(18),pt(19),pt(20)
cr(6)=circle/pt(22),pt(21),pt(16)
cr(7)=circle/pt(22),pt(23),pt(24)
ln(15)=line/pt(20),pt(24)
$$旋转、倒棱
ent(6)=solrev/ln(11..13),cr(3),origin,0,0,0,atangl,360,axis,1,0,0
blend/ent(6),radius,10
ent(7)=solrev/ln(14..15),cr(4..7),origin,0,0,0,atangl,360,axis,1,0,0
ent(8)=unite/ent(6),with,ent(7)
&color(ent(8))=&white
$$修型
obj2(1)=solcyl/origin,-k,0,0,height,k*2,diamtr,0.3*nr,axis,1,0,0
ent(9)=subtra/ent(8),with,obj2(1)
obj2(2)=solcyl/origin,-k,0.6*nr,0,height,2*k,diamtr,0.2*nr,axis,1,0,0
m=intf(3.1415926*nr/(0.4*nr))
g=1
w=3
xh2:
ifthen/g<=m-1
mat5=matrix/yzrot,g*(360/m)
obj2(w)=transf/mat5,obj2(2)
w=w+1
g=g+1
jump/xh2:
endif
ent(10)=subtra/ent(9),with,obj2(2..w-1)
$$消隐辅助点、线
blank/pt(1..24),cr(1..7),ln(1..15),obj1(1..3)
cancel:
halt |