- UID
- 192676
- 积分
- 71
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-11-14
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
//2个poly求交,结果错误
Acad::ErrorStatus polyjiao(AcDbObjectId polylineId1,AcDbObjectId polylineId2,AcDbObjectId& polylineId)
{
AcDbObjectId e0Id,e1Id;
AcGeCurve2d *Gpln0;
AcGeCurve2d *Gpln1;
AcGeInterval Ginv0,Ginv1,Ginv2;
//=============================
//选择两条多义线
AcDbPolyline *pent;
acdbOpenObject(pent,polylineId1,AcDb::kForWrite);
convertPolylineToGeCurve(pent,Gpln0);
pent->close();
AcDbPolyline *pent2;
acdbOpenObject(pent2,polylineId2,AcDb::kForWrite);
convertPolylineToGeCurve(pent2,Gpln1);
pent2->close();
Gpln0->getInterval(Ginv0);
double bv0,bv1;
Ginv0.getBounds(bv0,bv1);
ads_printf("\n00:bv0=%f,bv1=%f",bv0,bv1);
Gpln1->getInterval(Ginv1);
Ginv1.getBounds(bv0,bv1);
ads_printf("\n01:bv0=%f,bv1=%f",bv0,bv1);
if(Ginv1.intersectWith(Ginv0,Ginv2)==Adesk::kTrue)
{
ads_printf("\nkTrue");
}
Ginv0.getBounds(bv0,bv1);
ads_printf("\n0:bv0=%f,bv1=%f",bv0,bv1);
Ginv1.getBounds(bv0,bv1);
ads_printf("\n1:bv0=%f,bv1=%f",bv0,bv1);
Ginv2.getBounds(bv0,bv1);
ads_printf("\n2:bv0=%f,bv1=%f",bv0,bv1);
double approxEps=0.001;
AcGePoint2dArray pntArr;
AcGeDoubleArray paramArr;
AcGeDoubleArray *ptayy=new AcGeDoubleArray();
Gpln0->getSamplePoints(bv0,bv1,approxEps,pntArr,paramArr);
ptayy->append(paramArr);
AcGePoint3dArray ptArr;
AcDbObjectId textBoundaryId;
AcGePoint2dArraytoAcGePoint3dArray(pntArr,ptArr);
DrawPolyline(textBoundaryId,ptArr,1,0,TRUE,"0","CONTINUOUS");
return Acad::eOk;
} |
|