修改多段线的凸度

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了修改多段线的凸度相关的知识,希望对你有一定的参考价值。

 技术分享

 

static void zffObjectARX_MyCommand5(void)
{
ads_point pick;
ads_name name;
if (acedEntSel(NULL,name,pick)!=RTNORM)
{
return;
}
AcGePoint3d ptClosest;
AcDbObjectId polyId;
double param;
AcDbPolyline* pPoly=NULL;
acdbGetObjectId(polyId,name);
acdbOpenObject(pPoly,polyId,AcDb::kForWrite);
pPoly->getClosestPointTo(asPnt3d(pick),ptClosest);
pPoly->getParamAtPoint(ptClosest,param);
int vernum=int(param);
int vernumEnd=int(param+1);
AcGePoint3d ptS,ptE;
pPoly->getPointAt(vernum,ptS);
pPoly->getPointAt(vernumEnd,ptE);
pPoly->close();
AcGePoint2d ptCur;


int track=1,type;
struct resbuf result;
while (track>0)
{
acedGrRead(track,&type,&result);
ptCur.x=result.resval.rpoint[X];
ptCur.y=result.resval.rpoint[Y];
AcGeCircArc2d arc(CPointUtil::ToPoint2d(ptS),ptCur,CPointUtil::ToPoint2d(ptE));
AcGePoint2d ptCenter=arc.center();
AcGeVector2d verS(ptS.x-ptCenter.x,ptS.y-ptCenter.y);
double angleS=verS.angle();
AcGeVector2d verE(ptE.x-ptCenter.x,ptE.y-ptCenter.y);
double angleE=verE.angle();
double bulge=(angleE-angleS)/pi();

acdbOpenObject(pPoly,polyId,AcDb::kForWrite);
pPoly->setBulgeAt(vernum,bulge);
pPoly->close();
if (type==3)
{
track=0;
}
}

}












































以上是关于修改多段线的凸度的主要内容,如果未能解决你的问题,请参考以下文章

ObjectARX中三维多段线转二维多段线的方法

Pycomcad快速绘制参数化多段线的一种方法

pedit命令

C# | CAD批量导出多段线节点坐标(附源代码下载)

谁能提供一段vb在CAD中绘制多段线的实例代码作参考!

如何检查 3d 网格的凸度?