- UID
- 114481
- 积分
- 40
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-3-17
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本人绘制出了平面中给直线加箭头的一个简单程序,现在给空间直线加个箭头。不知道该怎么做!!以下是平面箭头程序。。。
double slopy , cosy , siny;
double Par=20,radius=15;//length of Arrow (>)
pointcenter.x=(point[1].x+point[0].x)/2.00;
pointcenter.y=(point[1].y+point[0].y)/2.00;
pointcenter.z=0.00;
//Par=(sqrt((pointcenter.x-point[0].x)*(pointcenter.x-point[0].x)+(pointcenter.y-point[0].y)*(pointcenter.y-point[0].y)))/16;
slopy = atan2( ( point[0].y-pointcenter.y ),( point[0].x - pointcenter.x ) );
cosy = cos( slopy );
siny = sin( slopy );
point1.x=pointcenter.x + int( Par * cosy - ( Par / 2.0 * siny ) );
point1.y=pointcenter.y + int( Par * siny + ( Par / 2.0 * cosy ) );
point1.z=0.00;
point2.x=pointcenter.x + int( Par * cosy + Par / 2.0 * siny );
point2.y=pointcenter.y - int( Par / 2.0 * cosy - Par * siny );
point2.z=0.00;
point3.x=point[0].x-radius*cosy;
point3.y=point[0].y-radius*siny;
point3.z=0.00;
point4.x=point[1].x+radius*cosy;
point4.y=point[1].y+radius*siny;
point4.z=0.00;
AcDbLine *Line= new AcDbLine(point3,point4);//画线
AcDbObjectId id;
postToDatabase(Line,id);
AcDbLine *Line1= new AcDbLine(pointcenter,point1);
AcDbObjectId id1;
postToDatabase(Line1,id1);
AcDbLine *Line2 = new AcDbLine(pointcenter,point2);
AcDbObjectId id2;
postToDatabase(Line2,id2);
AcDbCircle *Cire = new AcDbCircle(point[1],normal,radius);
AcDbObjectId circleId;
postToDatabase(Cire,circleId); |
|