View Issue Details

IDProjectCategoryView StatusLast Update
0032949CommunityOCCT:Modeling Algorithmspublic2024-04-15 11:35
Reporterskbizport Assigned To 
PrioritynormalSeverityblock 
Status assignedResolutionopen 
PlatformLinuxOSUbuntu 20.04 
Product Version7.6.0 
Target Version7.8.0 
Summary0032949: Modeling Algorithms - 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

Attached Files

  • BuildingPart.bbrep (6,433 bytes)
  • 0001-0032949-Modeling-Algorithms-Infinite-loop-in-ShapeUp.patch (3,119 bytes)

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

azv

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.

skbizport

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.

Thx

msv

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.

ibrahimsaad419_156253

2023-02-13 16:50

reporter   ~0113134

Hello @msv, I can reproduce this issue with the attached shape file.
BuildingPart.bbrep (6,433 bytes)

dpasukhi

2023-09-08 17:23

administrator   ~0114110

https://github.com/Open-Cascade-SAS/OCCT/pull/12

dpasukhi

2023-09-12 11:32

administrator   ~0114143

Dear @akaftasev
Please review
Need to review and adapt this commit:
0001-0032949-Modeling-Algorithms-Infinite-loop-in-ShapeUp.patch (3,119 bytes)

git

2023-09-18 18:48

administrator   ~0114180

Branch CR32949 has been created by andrey.kaftasev_159541.

SHA-1: 2735b47da4ab84eed20c7cc597126a1a3471cf99


Detailed log of new commits:

Author: akaftasev
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.

git

2023-09-18 18:55

administrator   ~0114181

Branch CR32949 has been updated forcibly by andrey.kaftasev_159541.

SHA-1: 955c3591908101e2727a1a1a439fde796969b81f

akaftasev

2023-09-19 13:05

developer   ~0114184

Please, review branch:
OCCT - CR32949

Results of testing:
http://jenkins-test-10.nnov.opencascade.com/view/CR32949-master-akaftasev/view/COMPARE/

akaftasev

2023-09-19 13:06

developer   ~0114185

Last edited: 2023-09-19 13:06

Represented earlier patch from user does not fix current problem.

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
2023-02-13 16:50 ibrahimsaad419_156253 Note Added: 0113134
2023-02-13 16:50 ibrahimsaad419_156253 File Added: BuildingPart.bbrep
2023-02-13 17:43 dpasukhi Summary Infinite loop in ShapeUpgrade_UnifySameDomain => Modeling Algorithms- Infinite loop in ShapeUpgrade_UnifySameDomain
2023-02-13 17:43 dpasukhi Description Updated
2023-02-13 17:43 dpasukhi Description Updated
2023-02-13 17:47 dpasukhi Summary Modeling Algorithms- Infinite loop in ShapeUpgrade_UnifySameDomain => Modeling Algorithms - Infinite loop in ShapeUpgrade_UnifySameDomain
2023-02-13 19:53 dpasukhi Assigned To skbizport => msv
2023-02-13 19:53 dpasukhi Status feedback => assigned
2023-09-08 17:23 dpasukhi Note Added: 0114110
2023-09-08 17:23 dpasukhi Assigned To msv => akaftasev
2023-09-08 17:24 dpasukhi Target Version => 7.8.0
2023-09-12 11:32 dpasukhi Note Added: 0114143
2023-09-12 11:32 dpasukhi File Added: 0001-0032949-Modeling-Algorithms-Infinite-loop-in-ShapeUp.patch
2023-09-15 13:53 dpasukhi Status assigned => resolved
2023-09-15 13:57 akaftasev Status resolved => assigned
2023-09-18 18:48 git Note Added: 0114180
2023-09-18 18:55 git Note Added: 0114181
2023-09-19 13:05 akaftasev Assigned To akaftasev => dpasukhi
2023-09-19 13:05 akaftasev Status assigned => resolved
2023-09-19 13:05 akaftasev Note Added: 0114184
2023-09-19 13:06 akaftasev Note Added: 0114185
2023-09-19 13:06 akaftasev Note Edited: 0114185
2024-04-15 11:35 dpasukhi Assigned To dpasukhi =>
2024-04-15 11:35 dpasukhi Status resolved => assigned