Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0032949: Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebjf
Copy link

@sebjf sebjf commented Aug 29, 2023

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.

…eDomain

RemoveEdgeFromMap() now returns how many entries it has removed, allowing RelocatePCurvesToNewUorigin() to detect if the edge map no longer has valid edges to advance through, and terminate if so preventing an infinite loop
@dpasukhi
Copy link
Contributor

dpasukhi commented Sep 8, 2023

@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 dpasukhi self-requested a review September 8, 2023 14:27
@dpasukhi dpasukhi self-assigned this Sep 8, 2023
@dpasukhi dpasukhi added the bug Something isn't working label Sep 8, 2023
@sebjf
Copy link
Author

sebjf commented Sep 8, 2023

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

@dpasukhi
Copy link
Contributor

dpasukhi commented Sep 8, 2023

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

@luzpaz
Copy link
Contributor

luzpaz commented Oct 15, 2023

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

@dpasukhi
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants