OCCT
OCCT copied to clipboard
0032949: Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain
This PR addresses 0032949: Infinite loop in ShapeUpgrade_UnifySameDomain.
As per the tracker, this occurs because the contour pcurve iteration in RelocatePCurvesToNewUorigin assumes that after the termination of the inner loop, theVEmap will be decremented and eventually empty entirely, however it is possible to provide a shape for which this is not the case.
This change updates RemoveEdgeFromMap() and RelocatePCurvesToNewUorigin() to detect if this happens and terminate.
Test Case
The issue can be reproduced by running UnifySameDomain on a problematic shape. E.g. I just add this snippet to the start of one of the examples,
TopoDS_Shape s;
BinTools::Read(s, "D:\\repo\\ISSUE_633\\shape.brep");
ShapeUpgrade_UnifySameDomain usd(s);
usd.Build();
There is a file (BuildingPart.bbrep) in the issue tracker to demonstrate it, but I have not been able to read it (BinTools doesn't seem to be aware of the format, even though the shape was only posted this year).
I also have a shape, but it is from a customer model so cannot be shared. If its not possible to reproduce with the shape from the issue tracker I can look again at getting permission, but its unlikely.
@sebjf Hello. Thank you for your fix. If you have not signed https://dev.opencascade.org/get_invoved/contributor_license_agreement And don't want to sign it - i will merge your fix into main repo using my profile. I will wait for your feedback.
Hi @dpasukhi, I have signed and submitted the CLA (though you can use your profile it that is easier!)
Great, i will transfer you commit from github to our repo on the next week (master for the current week is prepared)
@dpasukhi was this done ? is there a x-post link ?
For now the fix is not correct. We need to continue research.
PR has branch in gitolite occt repo. See: https://tracker.dev.opencascade.org/view.php?id=32949 Closing for completing and testing fix by OCCT team.