找回密码 注册 QQ登录
开思网工业级高精度在线3D打印服务

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 23290|回复: 21
打印 上一主题 下一主题

[分享]车轮(ug grip程序和prt)

[复制链接]
跳转到指定楼层
1
发表于 2005-12-5 17:33:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
先贴程序,然后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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

评分

参与人数 1技术 +1 收起 理由
tonybasic + 1 我很赞同

查看全部评分

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2005-12-5 17:41:40 | 只看该作者
车轮预览
初学二次开发的同学可以看看

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
3
发表于 2005-12-5 17:42:32 | 只看该作者
车轮预览
初学二次开发的同学可以看看

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
4
发表于 2005-12-5 18:51:58 | 只看该作者

金龙客车标志

entity/t1,t2,ln(10),pt(9),ent(5)
data/a,50,h,10
back:
param/'输入标志范围尺寸','标志长轴量(mm)',a,'标志厚度(mm)',h,rsp
jump/back:,cancel:,ok:,rsp
ok:
pt(1)=point/0,0
pt(2)=point/-a/10,0
$$外圈
t1=ellips/pt(1),a,1.3*a
t2=ellips/pt(1),1.1*a,1.3*a*1.1
$$参考点
pt(3)=point/pt(2),delta,-a/2*1.3,0,0
pt(4)=point/pt(2),delta,0,a/2*1.3,0
pt(5)=point/pt(4),delta,a/2*1.3,0,0
pt(6)=point/pt(2),delta,-a/5,0,0
pt(7)=point/pt(6),delta,a/2*1.3,0,0
ln(1)=line/pt(6),atangl,-45
ln(2)=line/pt(7),atangl,-45
pt(8)=point/ysmall,intof,ln(1),t2
pt(9)=point/ysmall,intof,ln(2),t2
delete/ln(1..2)
$$线条
ln(3)=line/pt(2),pt(3)
ln(4)=line/pt(3),pt(4)
ln(5)=line/pt(4),pt(5)
ln(6)=line/pt(5),pt(2)
ln(7)=line/pt(6),pt(7)
ln(8)=line/pt(7),pt(9)
ln(9)=line/pt(6),pt(8)
ln(10)=line/pt(8),pt(9)
$$拉伸成体
ent(1)=solext/t1,t2,height,h
ent(2)=solext/ln(3..6),height,h
ent(3)=solext/ln(7..10),height,h
$$处理、上色
blend/ent(1),radius,1
blend/ent(2),radius,1
blend/ent(3),radius,1
ent(4)=unite/ent(2),with,ent(3)
ent(5)=unite/ent(1),with,ent(4)
&color(ent(5))=&white
blank/pt,ln(3..10),t1,t2
cancel:
halt
5
发表于 2005-12-5 18:53:56 | 只看该作者
方向盘

entity/ln(100),cr(100),pt(100),obj(100),ent(10),csys1,csys2
number/mat1(12)
data/d,600
back:
param/'输入方向盘平均直径','方向盘平均直径(mm)',d,rsp
jump/back:,cancel:,ok:,rsp
ok:
$$尺寸判断
ifthen/d<500 or d>1000
messg/'尺寸超出范围(500-1000),请重新输入'
jump/back:
else
jump/l1:
endif
l1:
$$外圈
r=d/30
pt(1)=point/0,7*d/15
cr(1)=ellips/pt(1),r,1.5*r
ent(1)=solrev/cr(1),origin,0,0,0,atangl,360,axis,1,0,0
$$旋转坐标
ln(1)=line/0,0,-1,0,0,1
ln(2)=line/0,-1,0,0,1,0
csys1=csys/ln(1),ln(2)
&wcs=csys1
$$辐条
pt(2)=point/0,d/20,r
pt(3)=point/7*d/30,d/10,r
pt(4)=point/7*d/15,d/10,r
cr(2)=circle/pt(4),pt(3),pt(2)
pt(5)=point/0,0
ln(3)=line/pt(5),atangl,-60
mat1=matrix/mirror,ln(3)
cr(3)=transf/mat1,cr(2)
pt(6)=point/endof,xlarge,cr(3)
ln(4)=line/pt(2),pt(6)
pt(7)=point/0,0,r
obj(1)=fillet/cr(2),ln(4),center,pt(7),radius,50
obj(2)=fillet/ln(4),cr(3),center,pt(7),radius,50
pt(8)=point/pt(4),delta,0,-d/10,0
pt(9)=point/pt(7),delta,d*(cosf(60))/8,-d*(sinf(60))/8,0
pt(10)=transf/mat1,pt(8)
cr(4)=circle/pt(8),pt(9),pt(10)
pt(11)=point/endof,xsmall,cr(3)
ln(5)=line/pt(11),pt(10)
ln(6)=line/pt(8),pt(4)
ent(2)=solext/cr(2..4),obj(1..2),ln(4..6),height,2*r,axis,0,0,-1
blend/ent(2),radius,10
$$旋转坐标
ln(7)=line/pt(5),perpto,ln(3)
csys2=csys/ln(7),ln(3)
&wcs=csys2
$$生成联轴部分
ent(3)=solcyl/origin,0,0,-1.3*r,height,2.6*r,diamtr,d/5,axis,0,0,1
blend/ent(3),radius,10
cr(5)=circle/0,0,-1.3*r,d/15
cr(6)=circle/0,0,-1.3*r,d/30
ent(4)=solext/cr(5..6),height,4*r,axis,0,0,-1
ent(5)=unite/ent(1),with,ent(2..4)
$$隐藏多余实体
blank/cr(1..6),ln(1..7),pt(1..11)
$$上色
&color(ent(5))=&gray
cancel:
halt
6
发表于 2005-12-5 18:57:58 | 只看该作者
这个有意思:

entity/cyl,ln1,ln2,cir,cir1,cir2,cir3,  $申明实体
pt0,pt1,pt2,bh(100),sh(100)
data/r1,100,r2,80,r3,8,h,60,ra1,12,ra2, $参数初始化
15,hou,30,n,5,i,2
number/mat1(12)
l10:                  $$用户参数设置
param/'请输入模具参数','通孔数(小于100)',int,n,$
'外半径',r1,'内半径',r2,'小孔半径',r3,'实体高度',$
h,'底角圆角半径',ra1,'顶角圆角半径',ra2,'肋板厚',hou,rps
jump/l10:,hal:,next:,rps
next:         $$建模         
angl=180/n
mat1=matrix/xyrot,(ang=angl*2)
sin=sinf(angl)
cos=cosf(angl)
y0=hou/2
x0=y0*cos/sin
x=(x0+r2*cos)/2
y=(y0+r2*sin)/2
pt1=point/0,0
pt2=point/x,y
ln1=line/(pt0=point/x0,y0),atangl,ang$$生成曲线
ln2=line/(pt0=point/x0,y0),atangl,0
cir=circle/center,pt1,radius,r2,start,30,end,60
cir1=fillet/ln1,ln2,center,pt2,radius,ra2
cir2=fillet/ln2,cir,center,pt2,radius,ra1
cir3=fillet/cir,ln1,center,pt2,radius,ra1
bh(1)=solext/ln1,ln2,cir,cir1,cir2,cir3,height,h $$拉伸大孔
sh(1)=solcyl/origin,r2,0,0,height,h,diamtr,(d3=r3*2)$$拉伸小孔
l20$圆周阵列
ifthen/i<=n
j=i-1
bh(i)=transf/mat1,bh(j)
sh(i)=transf/mat1,sh(j)
i=i+1
jump/l20:
else
jump/l30:
endif
l30:
cyl=solcyl/origin,0,0,0,height,h,diamtr,(d1=r1*2)$$实体
cyl=subtra/cyl,with,bh(1..n),sh(1..n)  $$减去孔
hal:
halt
7
发表于 2005-12-5 18:59:48 | 只看该作者
entity/cyl,ln1,ln2,cir,cir1,cir2,cir3,  $申明实体
pt0,pt1,pt2,bh(100),sh(100)
data/r1,100,r2,80,r3,8,h,60,ra1,12,ra2, $参数初始化
15,hou,30,n,5,i,2
number/mat1(12)
l10:                  $$用户参数设置
param/'请输入模具参数','通孔数(小于100)',int,n,$
'外半径',r1,'内半径',r2,'小孔半径',r3,'实体高度',$
h,'底角圆角半径',ra1,'顶角圆角半径',ra2,'肋板厚',hou,rps
jump/l10:,hal:,next:,rps
next:         $$建模         
angl=180/n
mat1=matrix/xyrot,(ang=angl*2)
sin=sinf(angl)
cos=cosf(angl)
y0=hou/2
x0=y0*cos/sin
x=(x0+r2*cos)/2
y=(y0+r2*sin)/2
pt1=point/0,0
pt2=point/x,y
ln1=line/(pt0=point/x0,y0),atangl,ang$$生成曲线
ln2=line/(pt0=point/x0,y0),atangl,0
cir=circle/center,pt1,radius,r2,start,30,end,60
cir1=fillet/ln1,ln2,center,pt2,radius,ra2
cir2=fillet/ln2,cir,center,pt2,radius,ra1
cir3=fillet/cir,ln1,center,pt2,radius,ra1
bh(1)=solext/ln1,ln2,cir,cir1,cir2,cir3,height,h $$拉伸大孔
sh(1)=solcyl/origin,r2,0,0,height,h,diamtr,(d3=r3*2)$$拉伸小孔
l20: $$圆周阵列
ifthen/i<=n
j=i-1
bh(i)=transf/mat1,bh(j)
sh(i)=transf/mat1,sh(j)
i=i+1
jump/l20:
else
jump/l30:
endif
l30:
cyl=solcyl/origin,0,0,0,height,h,diamtr,(d1=r1*2)$$实体
cyl=subtra/cyl,with,bh(1..n),sh(1..n)  $$减去孔
hal:
halt
8
发表于 2005-12-5 19:01:19 | 只看该作者
循环语句——做阶梯轴

ENTITY/CYL(7),zhou
NUMBER/L(7),D(7),i,ZC
DATA/L,60,90,60,150,120,48,40,$
     D,24,32,40,48,64,48,40,i,1,ZC,0
LP1:IFTHEN/i<8
      CYL(i)=SOLCYL/ORIGIN,0,0,ZC,HEIGHT,L(i),DIAMTR,D(i)
      ZC=ZC+L(i)
      i=i+1
      JUMP/LP1:
    ELSE
      zhou=UNITE/CYL(1),WITH,CYL(2..7)
      HALT
    ENDIF
9
发表于 2005-12-5 19:16:19 | 只看该作者
跪求加分
10
发表于 2005-12-6 10:53:22 | 只看该作者
支持
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-12-18 17:28 , Processed in 0.031997 second(s), 12 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表