蜡笔小丸子 发表于 2012-5-12 22:04:35

求助:arx画出一条渐开线后再怎么画齿轮轮廓?

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();
这是我画的那一条渐开线,再怎么镜像,然后阵列和如何裁剪得到齿轮轮廓?
求各位大虾帮忙!!!

yu54211168 发表于 2012-5-13 00:09:00

每个女孩都曾是无泪的天使,当遇到自己喜欢的男孩时,便会流泪--于是变为凡人。所以男孩一定不要辜负女孩,因为女孩为你放弃了整个天堂!
页: [1]
查看完整版本: 求助:arx画出一条渐开线后再怎么画齿轮轮廓?