OCCT icon indicating copy to clipboard operation
OCCT copied to clipboard

0032949: Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain

Open sebjf opened this issue 2 years ago • 5 comments

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 avatar Aug 29 '23 15:08 sebjf

@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.

dpasukhi avatar Sep 08 '23 14:09 dpasukhi

Hi @dpasukhi, I have signed and submitted the CLA (though you can use your profile it that is easier!)

sebjf avatar Sep 08 '23 15:09 sebjf

Great, i will transfer you commit from github to our repo on the next week (master for the current week is prepared)

dpasukhi avatar Sep 08 '23 16:09 dpasukhi

@dpasukhi was this done ? is there a x-post link ?

luzpaz avatar Oct 15 '23 12:10 luzpaz

For now the fix is not correct. We need to continue research.

dpasukhi avatar Apr 15 '24 08:04 dpasukhi

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.

dpasukhi avatar Jun 27 '24 10:06 dpasukhi