点在区域内的判断
BOOL PointIsInPolygon(AcGePoint3d pt, AcGePoint3dArray ptArr){
int ptNum, i, interNum;
AcGePoint3d ptA, ptB;
ads采用point pt0, pt1, pt2, ptIns, ptX;
interNum = 0;
pt0 = 0.0;
pt0 = 0.0;
pt0 = 0.0;
ptX = pt.x;
ptX = pt.y;
ptX = pt.z;
ptNum = ptArr.length();
for (i = 0;i < ptNum - 1;i++) {
ptA = ptArr.at(i);
ptB = ptArr.at(i + 1);
pt1 = ptA.x;
pt1 = ptA.y;
pt1 = 0.0;
pt2 = ptB.x;
pt2 = ptB.y;
pt2 = 0.0;
if(acdbInters(ptX, pt0, pt1, pt2, 1, ptIns) == RTNORM) {
interNum++;
}
}
if (interNum % 2 == 0) {
return false;
}
else {
return true;
}
}
页:
[1]