ON_Curve::IntersectCurve gets stuck in an infinite loop

Hallo all

We migrate our project from Rhino5 to Rhino7 and now sometimes it happens that Rhino SDK function ON_Curve::IntersectCurve gets stuck in an infinite loop and we have to turn off the Rhino via Task Manager. The curves that I intersect are generated by the project and are valid. Also I tried different tolerances, but the same.
When I draw the curves with function RhinoApp().ActiveDoc()->AddCurveObject and intersect them with the same function, it is ok.
Has the same thing happened to anyone?


Best would be to provide an example and instruction hoe to replicate this.
A rhino file with 2 curves a some code to run for example.

This will isolate the issue and make it possible for a developer to test and debug.



Through some tests, I realized that ON_Curve::IntersectCurve gets stuck in an infinite loop when I try to intersect curves with different dimensions. But still, the function should not enter an infinite loop in this case.
I am sending you simple code from my test command.

ON_PolyCurve curves;

ON_LineCurve lineCrv1(ON_3dPoint(-13, 122.5, 0), ON_3dPoint(-13, 27.5, 0));
ON_Curve* crv1(lineCrv1.DuplicateCurve());
crv1->SetDomain(0, 1.0);

ON_LineCurve lineCrv11(ON_3dPoint(-13, 27.5, 0), ON_3dPoint(1499, 0, 0.01));
ON_Curve* crv11(lineCrv11.DuplicateCurve());
crv11->SetDomain(0, 1.0);

ON_Curve* crv = curves.DuplicateCurve();

ON_LineCurve lineCrv2(ON_2dPoint(-10, -400), ON_2dPoint(-10, 400));
ON_Curve* crv2(lineCrv2.DuplicateCurve());
int dim1 = crv->Dimension();
int dim2 = crv2->Dimension();
ON_SimpleArray<ON_X_EVENT> events;
int rstl = crv->IntersectCurve(

return CRhinoCommand::success;

Also, if curves of different dimensions are indeed not allowed in this function, then this information should be added to the function declaration

Hi @BiljanaN,

Why are you creating dimension=2 curves? Seems like the solution is not to do that.

– Dale

Hi Dale

Yes I know that now