TA的每日心情![](source/plugin/dsu_paulsign/img/emot/kx.gif) | 开心 昨天 15:13 |
---|
签到天数: 153 天 [LV.7]常住居民III
管理员
中国膜结构网www.mjgou.com
- 积分
- 2147483647
![QQ](static/image/common/qq_big.gif)
|
- double overlapInDir(AcDbEntity *pline1, AcDbEntity *pline2, const AcGeVector3d &vDir)
- {
- double angle = vDir.angleTo(AcGeVector3d::kXAxis, AcGeVector3d::kZAxis);
- AcGeMatrix3d mat;
- mat.setToRotation(-angle, AcGeVector3d::kZAxis);
-
- AcDbEntity *plineRot1=nullptr, *plineRot2=nullptr;
- Acad::ErrorStatus es;
- es = pline1->getTransformedCopy(mat, plineRot1);
- es = pline2->getTransformedCopy(mat, plineRot2);
- AcDbExtents ext1, ext2;
- es = plineRot1->getGeomExtents(ext1);
- es = plineRot2->getGeomExtents(ext2);
- delete plineRot1;
- delete plineRot2;
- double l1 = ext1.minPoint().x, r1 = ext1.maxPoint().x;
- double l2 = ext2.minPoint().x, r2 = ext2.maxPoint().x;
- double l = std::max(l1,l2), r = std::min(r1,r2);
- double overlap = r - l;
- return overlap;
- }
复制代码 |
|