- 积分
- 446
- 明经币
- 个
- 注册时间
- 2004-5-24
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2005-1-25 19:38:00
|
显示全部楼层
请指教
for(int k=0;k<3;k++) { AcTransaction *pTrans = actrTransactionManager->startTransaction(); AcDb3dSolid *pSolidWork = new AcDb3dSolid; pSolidWork = pWork->GetObject(pTrans,AcDb::kForWrite); AcDb3dSolid *pSolidTool = new AcDb3dSolid; pSolidTool = pTool->GetObject(pTrans,AcDb::kForWrite); AcDbRegion *pRegion = new AcDbRegion; pRegion = pTool->GetRegion(pTrans,AcDb::kForWrite); double t = -(76.0417*pi/180);//m_A=-1.5;// for(int i=0;i<n;i++) { { y_oc=x_0+(t*x_1)+(pow(t,2)*(x_2))+(pow(t,3)*(x_3))+(pow(t,4)*(x_4)); z_oc=y_0+(t*y_1)+(pow(t,2)*(y_2))+(pow(t,3)*(y_3))+(pow(t,4)*(y_4)); x_oc=z_0+(t*z_1)+(pow(t,2)*(z_2))+(pow(t,3)*(z_3))+(pow(t,4)*(z_4)); A=A_0+(t*A_1)+(pow(t,2)*(A_2))+(pow(t,3)*(A_3))+(pow(t,4)*(A_4)); B=B_0+(t*B_1)+(pow(t,2)*(B_2))+(pow(t,3)*(B_3))+(pow(t,4)*(B_4)); } traceofTool(k,i,x_oc,y_oc,z_oc,A,B); secB=pi/2-B; secA=A; OC.set(x_oc,y_oc,z_oc); O2.set(m_O2*sin(B),m_O2*cos(B),0); rotVA = O-O2; MyMove(pTrans,pSolidTool,OCL,OC); pRegion->transformBy(moved3D(OC[0]-OCL[0],OC[1]-OCL[1],OC[2]-OCL[2])); MyRotate(pTrans,pSolidWork,secB-firB,rotVB,O); MyRotate(pTrans,pSolidWork,secA-firA,rotVA,O);
copyAndCut(pSolidWork,pRegion,OC,axisDir);//copy and cut. pSolidWork->draw(); firB = secB; firA = secA; OCL=OC; t+=m_stept; } MyRotate(pTrans,pSolidWork,-secA,rotVA,O);
MyMove(pTrans,pSolidTool,OCL,O); pRegion->transformBy(moved3D(O[0]-OCL[0],O[1]-OCL[1],O[2]-OCL[2])); OCL.set(0,0,0); firA = 0; // MyRotate(pTrans,pSolidWork,m_stepg,rotVA,O); actrTransactionManager->endTransaction(); } AcTransaction *pTrans = actrTransactionManager->startTransaction(); AcDb3dSolid *pSolidWork = new AcDb3dSolid; pSolidWork = pWork->GetObject(pTrans,AcDb::kForWrite); MyRotate(pTrans,pSolidWork,-secB,rotVB,O); actrTransactionManager->endTransaction(); |
|