- 积分
- 347
- 明经币
- 个
- 注册时间
- 2004-11-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
//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; } |
|