MantisBT - Community
View Issue Details
0022793Community[OCCT] OCCT:Modeling Algorithmspublic2011-11-02 12:052015-05-14 16:24
szy 
bugmaster 
highblock 
closedfixed 
ALL
[OCCT] 6.5.2 
[OCCT] 6.9.0[OCCT] 6.9.0 
bugs modalg_6(011) bug22793
0022793: Boolean cut operation hangs computer
Post from the Forum - http://www.opencascade.org/org/forum/thread_21981/. [^]
1." Our application faces a great lot of data imported from IFC file which are produced from various CAD systems.
And few days ago, we got an IFC file. When we handle that IFC file by calling BRepAlgoAPI_Common and BRepAlgoAPI_Cut, we met an endless loop.

After debug, we found it is in method BRepClass3d_Solidexplorer::OtherSegment, line 554, myParamOnEdge*=0.5.
myParamOnEdge is decreased a half evey time. If the "return" sectence never meet before it, this value will be decreased to 0.000000000000. And then it will never change. So endless loop produced."

2. "Test data added.
- MS Windows 7 Win32 & VC9, OpenCASCADE 6.5.1, precision is by default.
Test method: TestOCCAPI method.txt
Test data: "Void.brep" cut "Positive.brep" cause endless loop.
Test data: "Void1.brep" cut "Positive.brep" can not get good result.
"
3." My modification:
line 554: else if(myParamOnEdge > Precision::Confusion()) myParamOnEdge*=0.5;
line 555: else{break;}

The endless loop can be fixed by the above modification.
But Precision::Confusion() = 1e-7, it is too small, start from 0.9 decrease to this value need 24 times. It will costs a lot of time to run the "while" loop 24 times.
Is there a better reasonalbe value to replace Precision::Confusion()? "


pload ALL
restore Positive.brep p
checkshape p
## Ok
toler p
## Ok
restore Void.brep v
checkshape v
## Ok
toler v
## Ok
bopcheck p
## Ok
bopcheck v
## Ok
bop p v
bopcut r
## !!! the last command hangs computer
No tags attached.
related to 0021762closed emv Open CASCADE Integration new Boolean Operation algorithm to OCC 
zip shapes21981.zip (2,697) 2011-11-02 12:05
https://tracker.dev.opencascade.org/
Issue History
2011-11-02 12:05szyNew Issue
2011-11-02 12:05szyAssigned To => jgv
2011-11-02 12:05szyFile Added: shapes21981.zip
2011-11-25 14:42szyStatusnew => assigned
2012-03-12 07:36abvTarget Version6.5.3 => 6.5.4
2012-10-23 19:14abvTarget Version6.5.4 => 6.6.0
2013-03-01 22:19abvRelationship addedrelated to 0021762
2013-03-01 22:20abvNote Added: 0023555
2013-03-01 22:20abvTarget Version6.6.0 => 6.7.0
2013-12-21 10:21abvTarget Version6.7.0 => 6.7.1
2014-04-04 18:27abvTarget Version6.7.1 => 6.8.0
2014-09-26 10:47abvTarget Version6.8.0 => 7.1.0
2015-04-10 13:08nbvNote Added: 0039562
2015-04-10 13:09nbvNote Added: 0039563
2015-04-10 13:09nbvAssigned Tojgv => msv
2015-04-10 13:09nbvStatusassigned => feedback
2015-04-10 13:09nbvNote Edited: 0039562bug_revision_view_page.php?bugnote_id=39562#r9917
2015-04-10 14:58msvNote Added: 0039578
2015-04-10 14:58msvStatusfeedback => resolved
2015-04-10 14:58msvAssigned Tomsv => bugmaster
2015-04-10 14:58msvStatusresolved => reviewed
2015-04-10 14:59msvTarget Version7.1.0 => 6.9.0
2015-04-10 15:51mkvAssigned Tobugmaster => mkv
2015-04-16 15:54gitNote Added: 0039896
2015-04-16 16:21mkvNote Added: 0039899
2015-04-16 16:21mkvAssigned Tomkv => bugmaster
2015-04-16 16:21mkvStatusreviewed => tested
2015-04-16 16:22mkvTest case number => bugs modalg_6(011) bug22793
2015-04-25 17:37bugmasterChangeset attached => occt master f3981c67
2015-04-25 17:37bugmasterStatustested => verified
2015-04-25 17:37bugmasterResolutionopen => fixed
2015-05-14 15:28aivStatusverified => closed
2015-05-14 15:30aivFixed in Version => 6.9.0
2015-05-14 16:24gitNote Added: 0040933

Notes
(0023555)
abv   
2013-03-01 22:20   
The problem is not reproduced on current master (though reproduced on 6.5.4), most likely because of changes introduced by 0021762. However, the offending code is still there.
(0039562)
nbv   
2015-04-10 13:08   
(edited on: 2015-04-10 13:09)
Current state of this issue:

...
dchrono dc start
bop p v
bopcut r
dchrono dc stop

dchrono dc show
Elapsed time: 0 Hours 0 Minutes 0.460014374179 Seconds
CPU user time: 0.0312002 seconds
CPU system time: 0.0156001 seconds

nbs r
#Number of shapes in r
# VERTEX : 13
# EDGE : 22
# WIRE : 10
# FACE : 10
# SHELL : 1
# SOLID : 1
# COMPSOLID : 0
# COMPOUND : 1
# SHAPE : 58


bopcut does not hang up.

However,

BRepClass3d_SolidExplorer::OtherSegment(...)
{
...
myParamOnEdge*=0.5; //line 614
if(myParamOnEdge < 0.0001) {
...
}

I.e. BRepClass3d contains offending code as before.

(0039563)
nbv   
2015-04-10 13:09   
Dear Mikhail,

Shall we fix something?
(0039578)
msv   
2015-04-10 14:58   
Not reproduced on the current master.
(0039896)
git   
2015-04-16 15:54   
Branch CR22793 has been created by mkv.

SHA-1: 1a5d45ba0ae64f2edd5e7c58a711b0b3a9c0ec6c


Detailed log of new commits:

Author: mkv
Date: Thu Apr 16 15:53:07 2015 +0300

    Test case for issue CR22793
(0039899)
mkv   
2015-04-16 16:21   
Dear BugMaster,
Test case
bugs modalg_6 bug22793
was created and pushed to new branch CR22793 of occt git-repository, it is OK.
(0040933)
git   
2015-05-14 16:24   
Branch CR22793 has been deleted by inv.

SHA-1: 1a5d45ba0ae64f2edd5e7c58a711b0b3a9c0ec6c