"> 相切圆··原程序~~~
相切圆··原程序~~~
论坛上很久以前的一个程序(忘记原创是谁了)···程序很有创意,十分巧妙。做了原程序发出来。
[attach]wsyzxxn@235087432001.rar[/attach]
[此贴子已经被作者于2007-6-13 23:18:40编辑过]
应该“f1”吧``是构造特征 在构造菜单的最后一项。
这是他程序的后半部分,请看第二行
(dof1)
if/(1)
jumpto/(dof1end)
else
f(f1)=feat/circle,outer,cart,qx,qy,qz,0,0,1,qd
f(直线1)=feat/line,unbnd,cart,53.729,28.186,0,-0.9829258,-0.1840022,0,0,0,1
const/line,f(直线1),bf,f(f1),f(圆a)
f(直线2)=feat/line,unbnd,cart,53.729,28.186,0,0.9847087,-0.174209,0,0,0,1
const/line,f(直线2),bf,f(f1),f(圆b)
f(直线3)=feat/line,unbnd,cart,53.729,28.186,0,-0.416378,0.9091916,0,0,0,1
const/line,f(直线3),bf,f(f1),f(圆c)
f(点1)=feat/point,cart,19.829,21.84,0,-0.9829258,-0.1840022,0
const/point,f(点1),pierce,fa(直线1),fa(圆a)
f(点2)=feat/point,cart,87.691,22.178,0,0.9847087,-0.174209,0
const/point,f(点2),pierce,fa(直线2),fa(圆b)
f(点3)=feat/point,cart,39.369,59.543,0,-0.416378,0.9091916,0
const/point,f(点3),pierce,fa(直线3),fa(圆c)
geoalg/circle,lstsqr
f(gy)=feat/circle,outer,cart,53.729,28.186,0,0,0,1,68.978
const/circle,f(gy),bf,fa(点1),fa(点2),fa(点3)
qx = assign/gy.x
qy = assign/gy.y
qz = assign/gy.z
qd = assign/gy.d
v1 = assign/v1+1
text/oper,"第"+v1+"次的x="+qx+"y="+qy
jumpto/(dof1)
endif
(dof1end)
t(位置2__x)=tol/cortol,xaxis,0,0
t(位置2__y)=tol/cortol,yaxis,0,0
t(位置2__d)=tol/diam,0,0
output/fa(gy),ta(位置2__x),ta(位置2__y),ta(位置2__d)
这是他程序的后半部分,请看第二行
我还没搞懂“if/(1)”是什么意思
if的条件是什么呢?
烦请楼上的版主解释一下、
高手和版主们都休假了么
按理说,if后面肯定是条件语句
楼上的,呵呵,也许吧,但是附件文件的后缀名是.prg,我可以认为他是pcdmis做的吗?
以下是pcdmis 下的文本复制(原帖找不到了)~做下参考吧!···另外楼上的版本是什么呢?
圆a =自动/圆,showallparams = 否,显示触测 = 是
理论值/10,20,0,0,0,1,20
实际值/10,20,0,0,0,1,20
目标值/10,20,0,0,0,1
测定/圆
触测/basic,20,20,0,-1,0,0,20,20,0
触测/basic,10,30,0,0,-1,0,10,30,0
触测/basic,0,20,0,1,0,0,0,20,0
触测/basic,10,10,0,0,1,0,10,10,0
终止测量/
圆b =自动/圆,showallparams = 否,显示触测 = 是
理论值/100,20,0,0,0,1,25
实际值/100,20,0,0,0,1,25
目标值/100,20,0,0,0,1
测定/圆
触测/basic,112.5,20,0,-1,0,0,112.5,20,0
触测/basic,100,32.5,0,0,-1,0,100,32.5,0
触测/basic,87.5,20,0,1,0,0,87.5,20,0
触测/basic,100,7.5,0,0,1,0,100,7.5,0
终止测量/
圆c =自动/圆,showallparams = 否,显示触测 = 是
理论值/30,80,0,0,0,1,45
实际值/30,80,0,0,0,1,45
目标值/30,80,0,0,0,1
测定/圆
触测/basic,52.5,80,0,-1,0,0,52.5,80,0
触测/basic,30,102.5,0,0,-1,0,30,102.5,0
触测/basic,7.5,80,0,1,0,0,7.5,80,0
触测/basic,30,57.5,0,0,1,0,30,57.5,0
终止测量/
圆1 =特征/圆,直角,内,最小二乘方
理论值/55,38.333,0,0,0,1,97.183
实际值/55,38.333,0,0,0,1,97.183
构造/圆,最佳拟合,圆a,圆b,圆c,,
outlier_removal/关,3
filter/关,upr=0
赋值/qx = 圆1.x
赋值/qy = 圆1.y
赋值/qz = 圆1.z
赋值/qd = 圆1.diam
赋值/v1 = 0
do/
f1 =一般/圆,从属,直角,外,$
标称值/xyz,qx,qy,qz,$
测定值/xyz,qx,qy,qz,$
标称值/ijk,0,0,1,$
测定值/ijk,0,0,1,$
直径/qd,qd
直线1 =特征/直线,直角,非定界
理论值/53.729,28.186,0,-0.9829258,-0.1840022,0
实际值/53.729,28.186,0,-0.9829258,-0.1840022,0
构造/直线,最佳拟合,2d,f1,圆a,,
outlier_removal/关,3
filter/关,wavelength=0
直线2 =特征/直线,直角,非定界
理论值/53.729,28.186,0,0.9847087,-0.174209,0
实际值/53.729,28.186,0,0.9847087,-0.174209,0
构造/直线,最佳拟合,2d,f1,圆b,,
outlier_removal/关,3
filter/关,wavelength=0
直线3 =特征/直线,直角,非定界
理论值/53.729,28.186,0,-0.416378,0.9091916,0
实际值/53.729,28.186,0,-0.416378,0.9091916,0
构造/直线,最佳拟合,2d,f1,圆c,,
outlier_removal/关,3
filter/关,wavelength=0
点1 =特征/点,直角
理论值/19.829,21.84,0,-0.9829258,-0.1840022,0
实际值/19.829,21.84,0,-0.9829258,-0.1840022,0
构造/点,刺穿,直线1,圆a
点2 =特征/点,直角
理论值/87.691,22.178,0,0.9847087,-0.174209,0
实际值/87.691,22.178,0,0.9847087,-0.174209,0
构造/点,刺穿,直线2,圆b
点3 =特征/点,直角
理论值/39.369,59.543,0,-0.416378,0.9091916,0
实际值/39.369,59.543,0,-0.416378,0.9091916,0
构造/点,刺穿,直线3,圆c
gy =特征/圆,直角,外,最小二乘方
理论值/53.729,28.186,0,0,0,1,68.978
实际值/53.729,28.186,0,0,0,1,68.978
构造/圆,最佳拟合,点1,点2,点3,,
outlier_removal/关,3
filter/关,upr=0
赋值/qx = gy.x
赋值/qy = gy.y
赋值/qz = gy.z
赋值/qd = gy.d
赋值/v1 = v1+1
注释/运算符,否,"第"+v1+"次的x="+qx+"y="+qy
until/abs(f1.x-gy.x)<=0.005 and abs(f1.y-gy.y)<=0.005
尺寸 位置2= 圆 的位置gy 单位=毫米 ,$
图示=关 文本=关 乘数=1.00 输出=两者
轴 标称值 正公差 负公差 测定 偏差 超差
x f1.x 0.000 0.000 53.729 0.000 0.000 ----#----
y f1.y 0.000 0.000 28.186 0.000 0.000 ----#----
直径 f1.d 0.000 0.000 68.978 0.000 0.000 ----#---- |