- 积分
- 16487
- 明经币
- 个
- 注册时间
- 2011-3-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
源码如下:
AcDbPolyline* DrawRoundheadPoly(const AcGePoint3d& sPt,const AcGePoint3d& ePt,double width)
{
AcGeVector3d vt = ePt - sPt;
AcGeVector3d prepVt = AcGeVector3d::kZAxis.crossProduct(vt).normalize();
AcGePoint3d pt1 = sPt + width*0.5*prepVt;
AcGePoint3d pt2 = sPt - width*0.5*prepVt;
AcGePoint3d pt3 = ePt - width*0.5*prepVt;
AcGePoint3d pt4 = ePt + width*0.5*prepVt;
AcDbPolyline* pPoly = new AcDbPolyline(4);
pPoly->addVertexAt(0,pt1.convert2d(AcGePlane::kXYPlane),1);
pPoly->addVertexAt(1,pt2.convert2d(AcGePlane::kXYPlane),0);
pPoly->addVertexAt(2,pt3.convert2d(AcGePlane::kXYPlane),1);
pPoly->addVertexAt(3,pt4.convert2d(AcGePlane::kXYPlane),0);
pPoly->setClosed(true);
return pPoly;
}
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|