|
[code]bool isPointOnRegion(AcGePoint3d pt,AcDbObjectId regionId)
{undefined
Acad::ErrorStatus es;
AcDbRegion* pRegion ;
es = acdbOpenObject( pRegion, regionId, AcDb::kForRead );
if( es ) return false;
//创建射线,根据射线与面域边线相交的点数为奇数就说明点在面域上的理论
AcDbRay* pRay = new AcDbRay ;
pRay->setBasePoint( pt );
pRay->setUnitDir( AcGeVector3d(1, 0, 0));
AcGePlane projPlane = AcGePlane(AcGePoint3d(0,0,0), AcGeVector3d(0,0,1));
AcGePoint3dArray ptArray;
es = pRegion->intersectWith( pRay, AcDb::kOnBothOperands,projPlane, ptArray,0,0 );//AcDb::kExtendArg
pRegion->close();
delete pRay;
if(es )
{undefined
return false;
}
int iNum = ptArray.length();
if( (iNum%2 ) == 0 ) return false;
return true;
}
[/code] |
|