明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1729|回复: 1

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

[复制链接]
发表于 2012-5-12 22:04:35 | 显示全部楼层 |阅读模式
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();
这是我画的那一条渐开线,再怎么镜像,然后阵列和如何裁剪得到齿轮轮廓?
求各位大虾帮忙!!!
发表于 2012-5-13 00:09:00 | 显示全部楼层
每个女孩都曾是无泪的天使,当遇到自己喜欢的男孩时,便会流泪--于是变为凡人。所以男孩一定不要辜负女孩,因为女孩为你放弃了整个天堂!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 10:11 , Processed in 0.158740 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表