View Issue Details

IDProjectCategoryView StatusLast Update
0032949CommunityOCCT:Modeling Algorithmspublic2022-07-26 23:37
Reporterskbizport Assigned Toskbizport  
Status feedbackResolutionopen 
PlatformLinuxOSUbuntu 20.04 
Product Version7.6.0 
Summary0032949: Infinite loop in ShapeUpgrade_UnifySameDomain

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.

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



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.


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.



2022-06-28 06:55

administrator   ~0109314

Dear @skbizport,

Do you have any updates concerning this issue?
It is impossible to find the root cause of the hang without the shape.


2022-07-26 22:41

reporter   ~0110008

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.



2022-07-26 23:37

developer   ~0110009

To make a snapshot of the shape before unify same domain algorithm, just insert in your program the following code:
  BinTools::Write (aShape, "file.bbrep");

Then attach the produced shape file here. Thanks.

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
2022-06-28 06:55 azv Assigned To azv => skbizport
2022-06-28 06:55 azv Status new => feedback
2022-06-28 06:55 azv Note Added: 0109314
2022-07-26 22:41 skbizport Note Added: 0110008
2022-07-26 23:37 msv Note Added: 0110009