Archived issue #0032949
Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain
Description
Hi
ShapeUpgrade_UnifySameDomain tool sometimes goes into infinite loop. Upon further investigation, it turns out that in function
RelocatePCurvesToNewUorigin(), there are 3 nested for loops and CurEdge is not updated in following loop
Boolean operation I was trying contained pipe like structure with another cylinder cut (with exactly same radius as inner radius of pipe). After the operation, tried to simplify the shape which caused this infinite loop.
Will appreciate if someone can take look and put an exit condition in these loops.
OCCT version 7.6, platform Ubuntu.
Thx
ShapeUpgrade_UnifySameDomain tool sometimes goes into infinite loop. Upon further investigation, it turns out that in function
RelocatePCurvesToNewUorigin(), there are 3 nested for loops and CurEdge is not updated in following loop
for (;;) //collect pcurves of a contour
{
//HERE, edge is not found in theVEmap, but the same map contains CurEdge's vertices with some other edges in their list
RemoveEdgeFromMap(CurEdge, theVEmap);
...
//Following returns non-zero entries
const TopTools_ListOfShape& Elist = theVEmap.FindFromKey(CurVertex);
if (Elist.IsEmpty()) {
break; //end of contour in 3d
}
...
for (; itl.More(); itl.Next())
{
//in this, CurEdge is never updated, i.e. next edge is not found
}
//Loop continues. If we detect this condition and exit from this loop, things work
}
Boolean operation I was trying contained pipe like structure with another cylinder cut (with exactly same radius as inner radius of pipe). After the operation, tried to simplify the shape which caused this infinite loop.
Will appreciate if someone can take look and put an exit condition in these loops.
OCCT version 7.6, platform Ubuntu.
Thx
Steps to reproduce
Approximate steps to reproduce this.
1. Create a cylinder of radius say 15 and cut another cylinder of smaller radius say 10 to create a pipe like shape. Can also create a pipe directly
3. Cut another cylinder of radius 10 (this results in touching surfaces for boolean operations)
4. Call ShapeUpgrade_UnifySameDomain
5. Simplify goes into infinite loop - potentially due to some inaccuracies after boolean operation.
Will try to provide BREP's for testing - once I get time. Busy ATM
1. Create a cylinder of radius say 15 and cut another cylinder of smaller radius say 10 to create a pipe like shape. Can also create a pipe directly
3. Cut another cylinder of radius 10 (this results in touching surfaces for boolean operations)
4. Call ShapeUpgrade_UnifySameDomain
5. Simplify goes into infinite loop - potentially due to some inaccuracies after boolean operation.
Will try to provide BREP's for testing - once I get time. Busy ATM
Public activity
12 archived notes
Participants are labeled by their role within this record.
I tried to reproduce it in draw using the following script:
But it works without any hanging.
So, the input shape is highly needed to reproduce the bug.
pcylinder c1 15 20 pcylinder c2 10 20 bcut r1 c1 c2 pcylinder c3 10 20 bcut r2 r1 c3 unifysamedom r3 r2
But it works without any hanging.
So, the input shape is highly needed to reproduce the bug.
I will attach input shape. Pls examine all the exit criteria for the the loops mentioned above in the meanwhile.
Thx
Thx
Dear Commenter 1,
Do you have any updates concerning this issue?
It is impossible to find the root cause of the hang without the shape.
Do you have any updates concerning this issue?
It is impossible to find the root cause of the hang without the shape.
I have fixed it locally. I understand you need sample data to reproduce this. It is little challenging in my current environment setup. Will sure try.
Thx
Thx
To make a snapshot of the shape before unify same domain algorithm, just insert in your program the following code:
Then attach the produced shape file here. Thanks.
BinTools::Write (aShape, "file.bbrep");
Then attach the produced shape file here. Thanks.
Hello Commenter 3, I can reproduce this issue with the attached shape file.
Attachment 2 (BBREP) (6,433 bytes)
Dear Commenter 5
Please review
Need to review and adapt this commit:
Please review
Need to review and adapt this commit:
Attachment 1 (PATCH) (3,119 bytes)
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: Commenter 7
Date: Mon Sep 18 16:49:06 2023 +0100
0032949: Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain
Problem occurs when InternalEdges is empty but the vertices from VV is not same.
Added condition to stop the loop when InternalEdges is empty.
[revision removed]
Detailed log of new commits:
Author: Commenter 7
Date: Mon Sep 18 16:49:06 2023 +0100
0032949: Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain
Problem occurs when InternalEdges is empty but the vertices from VV is not same.
Added condition to stop the loop when InternalEdges is empty.
Branch [archived branch] has been updated forcibly by Participant.
[revision removed]
[revision removed]
Please, review branch:
OCCT - CR32949
Results of testing:
http://jenkins-test-10.nnov.opencascade.com/view/CR32949-master-Commenter 7/view/COMPARE/
OCCT - CR32949
Results of testing:
http://jenkins-test-10.nnov.opencascade.com/view/CR32949-master-Commenter 7/view/COMPARE/
Represented earlier patch from user does not fix current problem.