- 积分
- 86
- 明经币
- 个
- 注册时间
- 2012-5-9
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
double z=20,m=2,r,ha=1,c=0.25,ar,fr,br;
r=0.5*m*z;
ar=0.5*(m*z+2*ha*m);
fr=0.5*(m*z-2*(ha+c)*m);
br=0.5*(m*z)*cosf(20*3.141592654/180);
AcGePoint3d yuanxin(0,0,0);
AcGeVector3d fangxiang(0.0,0.0,1.0);
AcDbCircle *pCircle1=new AcDbCircle(yuanxin,fangxiang,r);
AcDbCircle *pCircle2=new AcDbCircle(yuanxin,fangxiang,ar);
AcDbCircle *pCircle3=new AcDbCircle(yuanxin,fangxiang,fr);
AcDbCircle *pCircle4=new AcDbCircle(yuanxin,fangxiang,br);
AcDbBlockTable *pBlockTable;
acdbHostApplicationServices()->workingDatabase() ->getBlockTable
(pBlockTable,AcDb::kForRead);
AcDbBlockTableRecord *pblocktablerecord;
pBlockTable->getAt(ACDB_MODEL_SPACE,pblocktablerecord,AcDb::kForWrite);
//创建渐开线
double px,py,pz;
double rk,ok;
int i;
double PI=3.141592654;
AcGePoint3dArray points;
for(i=0;i<40;i++)
{rk=br/cosf(i*PI/180);
ok=sinf(i*PI/180)/cosf(i*PI/180)-i*PI/180;
px=rk*cosf(ok);
py=rk*sinf(ok);
pz=0;
AcGePoint3d p(px,py,pz);
points.append (p);
}
AcDbSpline *spline1=new AcDbSpline(points);
AcDbObjectId cir1;
pblocktablerecord->appendAcDbEntity(cir1,pCircle1);
AcDbObjectId cir2;
pblocktablerecord->appendAcDbEntity(cir2,pCircle2);
AcDbObjectId cir3;
pblocktablerecord->appendAcDbEntity(cir3,pCircle3);
AcDbObjectId cir4;
pblocktablerecord->appendAcDbEntity(cir4,pCircle4);
AcDbObjectId sp1;
pblocktablerecord->appendAcDbEntity(sp1,spline1);
pBlockTable->close();
pblocktablerecord->close();
pCircle1->close();
pCircle2->close();
pCircle3->close();
pCircle4->close ();
spline1->close();
这是我画的那一条渐开线,再怎么镜像,然后阵列和如何裁剪得到齿轮轮廓?
求各位大虾帮忙!!! |
|