Intersection.CurveCurve (and others) in R6 vs R5

Were there any changes made to the Geometry.Intersection methods from R5 to R6 that might make a call hang indefinitely?

I have a few components that rely heavily on them. I’ve been working/testing in Rhino 5, and things work as expected, but they “freeze” when run in Rhino 6. The VS profiler is saying that it’s getting stuck on the first call to Intersection.CurveCurve. And when I replace one, it hangs on the next. In one case, it got stuck on Intersection.CurveBrep, but Intersection.RayShoot works…

I haven’t been able to reproduce the issue with simpler case, so I’m pretty sure it’s the project, I’m just not sure how to debug the issue. It doesn’t throw any errors or return any values, just chugs along forever. Looking for some hints on what to investigate. The types of intersections are wildly varied, so I can’t write specific replacements without rewriting almost the whole project.

Thanks for any direction.

Can you test if the same curves hang when you try to intersect using the Rhino Intersect command?One thing to check is tolerances, and if they might be too small?
If that does not give any useful information, please share a sample code and 3dm/GH file example with the curves you are intersecting.

1 Like

Sorry the question is vague, I’ve been having trouble even finding the curves causing the problem. Since I posted, I’ve discovered that it’s not hanging on the first call but on some subset of curves that happen frequently.

I managed to find a pair (attached). There’s no hanging when I run them through the rhino command, grasshopper intersect components, or a new component I made that just calls the problem code from my project:

Intersection.CurveCurve(crvA, crvB, 1, 1));

The curves in the rhino file are created from Objects.AddCurve(crv), but before then they only exist “in the definition.”

err.3dm (38.5 KB)

I ran the script in this page using your curves, and it did not hang, even when us 1 for tolerances. Not sure what is it in your project that cause it to hang.

Thank you for taking the time, I was worried that might happen. Will keep at it…

One thing to try is to change the tolerance from “1” to the document tolerance.