TA的每日心情 | 开心 7 小时前 |
---|
签到天数: 20 天 [LV.4]偶尔看看III
管理员
- 积分
- 1393
|
- BOOL PointIsInPolygon(AcGePoint3d pt, AcGePoint3dArray ptArr)
- {
- int ptNum, i, interNum;
- AcGePoint3d ptA, ptB;
- ads采用point pt0, pt1, pt2, ptIns, ptX;
-
- interNum = 0;
- pt0[X] = 0.0;
- pt0[Y] = 0.0;
- pt0[Z] = 0.0;
- ptX[X] = pt.x;
- ptX[Y] = pt.y;
- ptX[Z] = pt.z;
- ptNum = ptArr.length();
- for (i = 0;i < ptNum - 1;i++) {
- ptA = ptArr.at(i);
- ptB = ptArr.at(i + 1);
- pt1[X] = ptA.x;
- pt1[Y] = ptA.y;
- pt1[Z] = 0.0;
- pt2[X] = ptB.x;
- pt2[Y] = ptB.y;
- pt2[Z] = 0.0;
- if(acdbInters(ptX, pt0, pt1, pt2, 1, ptIns) == RTNORM) {
- interNum++;
- }
- }
- if (interNum % 2 == 0) {
- return false;
- }
- else {
- return true;
- }
- }
复制代码 |
|