MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0023453Community[OCCT] OCCT:Modeling Algorithmspublic2012-09-29 09:412012-11-16 13:17
Reporterabv 
Assigned Toabv 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version[OCCT] 6.5.3 
Target Version[OCCT] 6.5.4Fixed in Version[OCCT] 6.5.4 
Summary0023453: Infinite loop on cut operation
DescriptionThe problem is reported by Paul Jimenez on OCCT forum http://www.opencascade.org/org/forum/thread_16268 [^]

--

I am using BRepAlgoAPI_Cut to cut a Compound of Faces with another Compound of Faces. The process occurs interactively. I was forcing the application to perform the algorithm over and over again with different faces that constantly changed. After a few seconds of doing this the application stopped responding. Fortunately, it was running in the debugger, so I was able to find the place it got stuck in.

 The function where it occurs is IntTools_FClass2d::Init. The loop begins at line 188 in my copy of inttools_fclass2d.cxx. It is as follows:

      do {
       gp_Pnt P3db=C3d.Value(u);
       if(P3da.SquareDistance(P3db)) {
       degenerated=Standard_False;
       break;
       }
       u+=du;
      }
      while(u<plbid);

 Local variables:

 plbid: 6451.7439502819680
 u: 6451.7439502819643
 du: 3.6379788070917132e-013

 "u+=du" is not updating "u"s value because du is too small. plbid and u are the same up to the 11th decimal, which should be enough to exit the loop. In other words, a precision problem is causing this infinite loop.

...

Proposed patch:

 File: inttools_fclass2d.cxx
 Line: 183
 From: du=(plbid-pfbid)*0.1;
 To: du=(plbid-pfbid+BRep_Tool::Tolerance(edge))*0.1;

 I am not sure if that's the best tolerance value to use there, but at least it will guarantee a decent du.
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships

-  Notes
(0021600)
abv (manager)
2012-09-29 09:58
edited on: 2012-09-29 11:02

The fix is integrated to branch CR23453, please review.
Note that no test case is available, thus the fix is speculative: do {} while {} loop is replaced by for {} to make sure it is always finite.

(0021628)
jgv (developer)
2012-10-03 10:28

Reviewed with correction of misprint
(0021660)
mkv (tester)
2012-10-04 17:42

Dear BugMaster,
Branch CR23453 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Regressions:
Not detected

Improvements:
Not detected

Testing cases:
Not needed

- Related Changesets
occt: master 2478cd9d
Timestamp: 2012-10-05 09:58:17
Author: abv
Committer: abv
Details ] Diff ]
0023453: Infinite loop on cut operation

In IntTools_FClass2d.cxx, do {} while {} cycle is replaced by for () cycle to avoid possible infinite loop.
Check for degeneration is made with Precision::Confusion() precision instead of comparison with 0.
Correction of misprint
mod - src/IntTools/IntTools_FClass2d.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-09-29 09:41 abv New Issue
2012-09-29 09:41 abv Assigned To => jgv
2012-09-29 09:58 abv Note Added: 0021600
2012-09-29 09:58 abv Status new => resolved
2012-09-29 11:02 abv Note Edited: 0021600 View Revisions
2012-10-03 10:28 jgv Note Added: 0021628
2012-10-03 10:28 jgv Status resolved => reviewed
2012-10-03 18:13 mkv Assigned To jgv => mkv
2012-10-03 18:13 mkv Test case number => Not needed
2012-10-04 17:42 mkv Note Added: 0021660
2012-10-04 17:43 mkv Assigned To mkv => bugmaster
2012-10-04 17:43 mkv Status reviewed => tested
2012-10-08 16:14 abv Changeset attached => occt master 2478cd9d
2012-10-08 16:15 abv Assigned To bugmaster => abv
2012-10-08 16:15 abv Status tested => verified
2012-10-08 16:15 abv Resolution open => fixed
2012-11-16 13:14 bugmaster Fixed in Version => 6.5.4
2012-11-16 13:17 bugmaster Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker