acdb3dPolyline::intersectWith bug with the Z coordinate in Acad 2008

acdb3dPolyline::intersectWith bug with the Z coordinate in Acad 2008

Anonymous
Not applicable
791 Views
3 Replies
Message 1 of 4

acdb3dPolyline::intersectWith bug with the Z coordinate in Acad 2008

Anonymous
Not applicable

I have three entities, a AcdbLine[(0,0,1),(10,10,10)], a AcdbPolyline,and a Acdb3dPolyline[(1,10,1),(10,0,10)].  they have different Z value(not Zero).

execute the code below:

        AcDbObjectPointer<AcDbCurve> pCurve1(idPLs[0],AcDb::kForRead),pCurve2(idPLs[1],AcDb::kForRead);
        AcGePoint3dArray pt3dNodes;
        pCurve1->intersectWith(pCurve2,AcDb::kOnBothOperands,AcGePlane::kXYPlane,pt3dNodes);
        if (!pt3dNodes.isEmpty())
        {
            acutPrintf(_T("\nZ:%g"),pt3dNodes.first().z);
        }

 

as the ARX SDK says "it projects this entity and the pEnt entity onto the projPlane, finds the intersection points, and then projects the intersection points back onto this entity. So, all points appended to the points array will be on this entity. "

if  pCurve1 is Acdb3dPolyline, the intersection point is on pCurve2.  why? bug? 

if pCurve1 is not Acdb3dPolyline, works well as the SDK says.

 

0 Likes
792 Views
3 Replies
Replies (3)
Message 2 of 4

artc2
Autodesk
Autodesk

That's a bug in how this intersectWith is implemented in 3dpolyline. And, it appears to still be that way.  I'll see about getting it fixed.

0 Likes
Message 3 of 4

Anonymous
Not applicable

thanks much.

I want to get the intersection point on Acdb3dPolyline, then use "getParamAtPoint" to get the param ,but now the intersection point has wrong Z value?  what can I do if I still want to get param of the intersection point on this Acdb3dPolyline?

0 Likes
Message 4 of 4

owenwengerd
Advisor
Advisor

If the returned points are otherwise correct, you could project them manually back onto the source 3d polyline. For that you can either calculate it manually or call the other form of intersectWith and pass a line that passes through the returned point and is orthogonal to the projection plane.

--
Owen Wengerd
ManuSoft
0 Likes