View Issue Details

IDProjectCategoryView StatusLast Update
0032949CommunityOCCT:Modeling Algorithmspublic2022-04-28 18:31
Reporterskbizport Assigned Toazv  
PrioritynormalSeverityblock 
Status newResolutionopen 
PlatformLinuxOSUbuntu 20.04 
Product Version7.6.0 
Summary0032949: Infinite loop in ShapeUpgrade_UnifySameDomain
DescriptionHi

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 ReproduceApproximate 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

TagsNo tags attached.
Test case number

Activities

msv

2022-04-24 22:58

developer   ~0108132

I tried to reproduce it in draw using the following script:
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.

skbizport

2022-04-28 15:44

reporter   ~0108238

I will attach input shape. Pls examine all the exit criteria for the the loops mentioned above in the meanwhile.

Thx

Issue History

Date Modified Username Field Change
2022-04-23 05:11 skbizport New Issue
2022-04-23 05:11 skbizport Assigned To => msv
2022-04-24 22:58 msv Note Added: 0108132
2022-04-28 15:44 skbizport Note Added: 0108238
2022-04-28 18:31 msv Assigned To msv => azv