- 积分
- 247
- 明经币
- 个
- 注册时间
- 2004-4-1
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
程序调试通过,可是却无法执行,请高手帮忙查错,谢谢先!:)
目的是想通过四个点求其他点的坐标,保存成数组,再赋给点,用CAD命令连接。 double cord[1000][3]; ads_point pt[1000];
x1=pt1[x],y1=pt1[y],z1=0.0, x2=pt2[x],y2=pt2[y],z2=0.0, x3=pt3[x],y3=pt3[y],z3=0.0, x4=pt4[x],y4=pt4[y],z4=0.0;
a1=x2-x1; b1=y2-y1; deltx1=a1/n; delty1=b1/m; a2=x3-x4; b2=y3-y4; deltx2=a2/n; delty2=b2/m;
for(i=0;i<(m+1)*(n+1);i++) {cord[3]=0.0;} //初始化z坐标
for(i=0;i<=n;i++) //i为列循环 { xx1=x1+i*deltx1; yy1=y1+i*delty1; xx2=x4+i*deltx2; yy2=y4+i*delty2;
deltx3=(xx2-xx1)/m; delty3=(yy2-yy1)/m; cord[k][1]=xx1; cord[k][2]=yy1; cord[(m+1)*(i+1)][1]=xx2;cord[(m+1)*(i+1)][2]=yy2; for(j=1;j<=m-1;j++) //j为行循环 {xx3=xx1+j*deltx3; yy3=yy1+j*delty3; k++; cord[k][1]=xx3; cord[k][2]=yy3; k=k+2;}
} for(i=1;i<=1000;i++) {pt[x]=cord[1]; pt[y]=cord[2]; }
acedCommand(RTSTR,"3dface", RTPOINT,pt[1],//Firsr point RTPOINT,pt[2],//Second point RTPOINT,pt[6],//Third point RTPOINT,pt[5],//Forth point RTSTR,"", RTNONE); |
|