|
AcGePoint3dArray pts-所有点(sect1.pt1、sect1.pt2、…sect2.pt1,sect2.pt2…sectN.pt1和sectN.pt2…)
int clrInd-创建的AcDbPolygonMesh的颜色索引
int mSize-节中的点
int nSize-截面数量
AcDbPolygonMesh * createPolygonMesh(AcGePoint3dArray pts, int clrInd, int mSize, int nSize)
{
AcDbObjectId id;
AcDbPolygonMesh * pMesh = new AcDbPolygonMesh();
pMesh->setMSize(mSize);
pMesh->setNSize(nSize);
pMesh->makeMOpen();
pMesh->makeNOpen();
pMesh->setLinetype(_T("Continuous"));
pMesh->setPolyMeshType(AcDb::kSimpleMesh);
for (int i = 0; i < pts.length(); i++)
{
AcDbPolygonMeshVertex *pVert = new AcDbPolygonMeshVertex(pts.at(i));
pMesh->appendVertex(pVert);
}
pMesh->setColorIndex(clrInd);
appendToDatabase(pMesh,id); // it's just append entity to db.
pMesh->draw();
pMesh->close();
return pMesh;
} |
|