Message 1 of 3
intersectWith api has error, the intersect points are wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
a ray intersectWith a polyline,get three intersect points.but one point is wrong .it is not intersct point in fact. i use red line to join the three point.i have marked the three point "1,2,3". the third point is not intersect with polyline in fact.there are only two intersect points in fact. the following are the code. pts_intesect and pts_intesect2 are the same result.
AcGePoint3d pttemp = AcGePoint3d(ptc.x + drad*cos(dang),ptc.y+ drad*sin(dang),ptc.z);
AcDbRay* pray = new AcDbRay();
pray->setBasePoint(pttemp);
pray->setUnitDir(rayvec);
AcGePoint3dArray pts_intesect;
vector<AcGePoint3d> vec1;
err = polyLine->intersectWith(pray, AcDb::kExtendArg, pts_intesect);
for each (AcGePoint3d var in pts_intesect)
{
vec1.push_back(var);
}
AcGePoint3dArray pts_intesect2;
vector<AcGePoint3d> vec2;
err = pray->intersectWith(polyLine, AcDb::kExtendThis, pts_intesect2);
for each (AcGePoint3d var in pts_intesect2)
{
vec2.push_back(var);
}
delete pray;