- UID
- 34598
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-3-10
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
晓东,你好!
我现在有个问题:
我不知道如何画由一条带直线和和弧线组成的多义线旋转而成的三维立体图!
我原先是这样做的:
AcGePoint2dArray pt2d;
AcGeVector3d normal(0.0, 0.0, 1.0);
AcDbPolyline *poly = new AcDbPolyline;
AcGePoint3d moveBy(0, 0, 0);
pt2d.setLogicalLength(8);
pt2d[0].set(x1, y1);
pt2d[1].set(x2, y2);
pt2d[2].set(x3, y3);
pt2d[3].set(x4, y4);
pt2d[4].set(x5, y5);
pt2d[5].set(x6, y6);
pt2d[6].set(x7, y7);
pt2d[7].set(x8, y8);
//其中(xi, yi)代表顶点的坐标
AcDbPolyline *poly = new AcDbPolyline;
for(int i = 0; i < 8; i++)
{
poly->addVertexAt(i, pt2d);
}
poly->setClosed(Adesk::kTrue);
poly->setNormal(normal);
AcDbVoidPtrArray lines, regions;
lines.append((void *)poly);
AcDbRegion::createFromCurves(lines, regions);
AcDbRegion *pRegion = AcDbRegion::cast((AcRxObject *)regions[0]);
AcDb3dSolid *p3dObj = new AcDb3dSolid;
AcGePoint3d axisPoint(0.0, 0.0, 0.0);
AcGeVector3d axisDir(0.0, 1.0, 0.0);
double Revolution = 2.0 * PI;
AcGePoint3d origin(0.0, 0.0, 0.0);
AcGeVector3d x(1, 0, 0), y(0, 1, 0), z(0, 0, 1);
AcGeMatrix3d mat;
if(Acad::eOk == p3dObj1->revolve(pRegion1, axisPoint, axisDir,
Revolution))
{
mat.setCoordSystem(origin, x, y, z);
p3dObj->transformBy(mat);
}
delete pRegion1;
//把实体假如数据库
AcDbObjectId p3dObjId = AddEntityToDbs(p3dObj);
p3dObj1->close();
可是,这只能话直线段的封闭多义线的旋转三维图!
恳请晓东帮忙!谢谢!!! |
|